httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edwards Jim <...@ur.se>
Subject RE: [users@httpd] mod_rewrite question
Date Thu, 11 Dec 2003 17:04:43 GMT
Hello Robert,
I got it working using:
RewriteRule ^([A-Za-z0-9_]+)*$ /folder/$1.php [L]
RewriteRule ^([A-Za-z0-9_]+)/([A-Za-z0-9_]+)*$ /folder/$2.php?parent=$1 [L]

Thanks for pointing me in the right direction.

Jim Edwards

-----Original Message-----
From: Robert Andersson [mailto:robert@profundis.nu] 
Sent: den 11 december 2003 06:57
To: users@httpd.apache.org
Subject: Re: [users@httpd] mod_rewrite question

Robert Andersson wrote:
> Probably. [...] this would do it:

Probably not :( I must not be getting enough coffee...

>     RewriteEngine On
>     RewriteRule ^/folder/(\w+)\.php /$1/
>     RewriteRule ^/folder/(\w+)\.php\?parent=(\w+) /$2/$1

Correction:

    RewriteRule ^/folder/(\w+)\.php$ /$1/
    RewriteRule ^/folder/(\w+)\.php\?parent=(\w+)$ /$2/$1

Note the end anchor $; without it this wouldn't work very well.

Regards,
Robert Andersson

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message