Apache Server configuration support - just another simple mod_rewrite problem.

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > December 2005 > just another simple mod_rewrite problem.





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author just another simple mod_rewrite problem.
Cat

2005-12-26, 5:59 pm

hi,

i have read dozens of previous questions and answers but for some
reason i cannot find a solution to this simple question..

i want to use the rewrite engine to convert addresses like
http://www.domain.com/?subpage to http://www.domain.com/subpage . my
..htaccess file looks like:

RewriteEngine On
RewriteRule ^/([a-z]+)/$ index.php?$1 [L]

i get a nice 404 when i try to access http://www.domain.com/subpage

any help is much appreciated.


regards
cat.

Robert Ionescu

2005-12-26, 5:59 pm

Cat wrote:
> i want to use the rewrite engine to convert addresses like
> http://www.domain.com/?subpage to http://www.domain.com/subpage . my
> ..htaccess file looks like:
>
> RewriteEngine On
> RewriteRule ^/([a-z]+)/$ index.php?$1 [L]
>
> i get a nice 404 when i try to access http://www.domain.com/subpage


In per-dir context (i.e. .htaccess files), the pattern of the
RewriteRule (left side) does not start with a leading slash:

RewriteEngine On
RewriteRule ^([a-z]+)/$ /index.php?$1 [L]

--
Robert
Cat

2005-12-27, 7:50 am

hi,

thank you very much for your help. it is now working as it should


regards
cat.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com