MrBelfry
IS-IT--Management
- May 21, 2003
- 289
Hello
I have a mod_rewrite problem. I'm trying to rewrite a url that looks like this: to rewrite to pages.php?section=about&pagename=index
I've had this working on my windows box at work (but I put the rewrite rules in the conf file) but on my linux host (using a htaccess file in the 'new' folder I cannot get it to work. Help!
Here are my rules
NB. I can rewrite the homepage no problem i.e works fine.
MrBelfry
I have a mod_rewrite problem. I'm trying to rewrite a url that looks like this: to rewrite to pages.php?section=about&pagename=index
I've had this working on my windows box at work (but I put the rewrite rules in the conf file) but on my linux host (using a htaccess file in the 'new' folder I cannot get it to work. Help!
Here are my rules
Code:
RewriteEngine on
#catch index page
RewriteRule ^$ pages.php?section=home&pagename=index [L,NS,QSA]
RewriteRule ^\index.html$ pages.php?section=home&pagename=index [L,NS,QSA]
#if we try to access an html file then we rewrite otherwise we ignore
RewriteRule ^/([^/]*)/$ pages.php?section=$1&pagename=index [L,NS,QSA]
RewriteRule ^/([^/]*)/([^/]*).html$ pages.php?section=$1&pagename=$2 [L,NS,QSA]
NB. I can rewrite the homepage no problem i.e works fine.
MrBelfry