[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cobalt-users] Mod_Rewrite Problems



Hey I finally got it working.

Below is what I had to do to get Mod_Rewrite working, and an example of
Mod_Rewrite converting .html files and path to typical PHP URL -
index.php?cid=category&id+page.

Hope this helps someone, and thank you for the help every one who did!!


Access.conf (added to the bottom)
---------------------
<Directory /home/sites/site45/web>
Options All
AllowOverride All
</Directory>
---------------------


.htaccess
---------------------
AuthName "[PRIVATE]"
AuthType Basic
AuthPAM_Enabled off
AuthUserFile "/home/sites/site45/web/ht/.htpasswd"
<LIMIT GET POST>
Require valid-user
</LIMIT>

RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_URI} !^/images/
RewriteCond %{REQUEST_URI} !^/css/
RewriteCond %{REQUEST_URI} !^/ht/

RewriteRule ^([a-z0-9]*)\.html$  index.php?cid=$1&id=$1
[L]
RewriteRule ^([a-z0-9]*)/([a-z0-9]*)\.html$ index.php?cid=$1&id=$2
[L]
RewriteRule ^([a-z0-9]*)/([a-z0-9]*)/([a-z0-9]*)\.html$
index.php?cid=$2&id=$3                          [L]
RewriteRule ^([a-z0-9]*)/([a-z0-9]*)/([a-z0-9]*)/([a-z0-9]*)\.html$
index.php?cid=$3&id=$4              [L]
RewriteRule
^([a-z0-9]*)/([a-z0-9]*)/([a-z0-9]*)/([a-z0-9]*)/([a-z0-9]*)\.html$
index.php?cid=$4&id=$5  [L]
---------------------

Simon H

> -----Original Message-----
> From: Brian Quinn [mailto:brian@xxxxxxxxx] 
> Sent: 18 November 2002 18:26
> To: cobalt-users@xxxxxxxxxxxxxxx
> Subject: RE: [cobalt-users] Mod_Rewrite Problems
> 
> 
> i'm not sure if this has been mentioned before,
> 
> but if you are using the mod_rewrite, you need to make sure 
> you have the 
> ReWrite Engine turned on for that domain
> 
> the syntax is:
> RewriteEngine On
> 
> 
> add this above your rewrite rule.
> also, you can turn the rewrite log on and look at the errors 
> to see what's 
> going wrong, that's how i trouble shoot mine.
> 
> 
> Brian
> 
> 
> 
> At 05:28 PM 11/18/2002 +0000, you wrote:
> >Thanks, but now I'm really confused!
> >
> >To avoid further confusion and another 20 emails, perhaps you or 
> >someone else could explain the following:
> >
> >1. What has to be modified in my .htaccess attached earlier? 
> 2. Are the 
> >Mod_Rewrite rules gonna work, or is there likely to be 
> >incompatibilities? 3. What has to be added to the access.conf, and 
> >where? 4. Does anything else need changed?
> >
> >Sorry for the bluntness, but this thread could go on forever and get 
> >even more cryptic.
> >
> >Thanks again
> >
> >Simon H
> >
> > > -----Original Message-----
> > > From: Bruce Timberlake [mailto:bruce@xxxxxxxxxx]
> > > Sent: 18 November 2002 17:14
> > > To: cobalt-users@xxxxxxxxxxxxxxx
> > > Subject: Re: [cobalt-users] Mod_Rewrite Problems
> > >
> > >
> > > -----BEGIN PGP SIGNED MESSAGE-----
> > > Hash: SHA1
> > >
> > > On Monday 18 November 2002 09:07 am, Simon Hamilton [4sol] wrote:
> > > > I have done as you suggested in the access.conf.
> > > >
> > > > At the end of the access.conf I added:
> > > >
> > > > -----------
> > > > <Directory /home/sites/site45/web>
> > > > AllowOverride All
> > > > Options All
> > > > AuthPAM_Enabled off
> > > > </Directory>
> > > > -----------
> > > >
> > > > Is this what you mean, or do I have to edit it elsewhere?
> > > Do I need
> > > > to restart Apache after also?
> > >
> > > Sorry, I meant to put it in your .htaccess file.
> > >
> > > I don't think you need to restart Apache as it will just 
> parse the 
> > > .htaccess file upon attempted access.
> > >
> > > - --
> > > Bruce Timberlake
> > > 
> > > -----BEGIN PGP SIGNATURE-----
> > > Version: GnuPG v1.2.1 (GNU/Linux)
> > >
> > > iD8DBQE92R/xvLA2hUZ9kgwRAu+jAJwL/vnwebNg95EmmAnMFLs/6GAI0QCfYQkx
> > > LRWqNofB25qa92WLW7kdfYc=
> > > =lWY1
> > > -----END PGP SIGNATURE-----
> > >
> > > _____________________________________
> > > cobalt-users mailing list
> > > cobalt-users@xxxxxxxxxxxxxxx
> > > To subscribe/unsubscribe, or to SEARCH THE ARCHIVES, go to: 
> > > http://list.cobalt.com/mailman/listinfo/cobalt> -users
> > >
> >
> >_____________________________________
> >cobalt-users mailing list
> >cobalt-users@xxxxxxxxxxxxxxx
> >To subscribe/unsubscribe, or to SEARCH THE ARCHIVES, go to: 
> >http://list.cobalt.com/mailman/listinfo/cobalt-users
> 
> _____________________________________
> cobalt-users mailing list
> cobalt-users@xxxxxxxxxxxxxxx
> To subscribe/unsubscribe, or to SEARCH THE ARCHIVES, go to: 
> http://list.cobalt.com/mailman/listinfo/cobalt> -users
>