mod_rewrite -> problems with optional / character
Posted: Fri Apr 28, 2006 3:22 pm
Hello together,
Entering http://www.webpage.de/products Apache redirects to the correct webpage http://www.webpage.de/products/maschine ... enbau.html
Entering http://www.webpage.de/products/ (notice the last / character) displays following error message:
File Not Found
The requested URL /products/ was not found on this server.
Following rule works out fine, http://www.webpage.de/products is displayed properly:
.htaccess:
-------------
Extending the RewriteRule with the optional character / at the end of products strangely brings the "File Not Found" error message for both cases:
http://www.webpage.de/products
and
http://www.webpage.de/products/
.htaccess incorrect:
------------------------
=> What am I doing wrong? Why can't I add the optional / at the end?
Thanks,
visionmaster
Entering http://www.webpage.de/products Apache redirects to the correct webpage http://www.webpage.de/products/maschine ... enbau.html
Entering http://www.webpage.de/products/ (notice the last / character) displays following error message:
File Not Found
The requested URL /products/ was not found on this server.
Following rule works out fine, http://www.webpage.de/products is displayed properly:
.htaccess:
-------------
Code: Select all
RewriteEngine on
RewriteRule ^.*/(.+)\.html$
RewriteRule /products$ http://www.webpage.de/products/maschinenbau/maschinenbau.htmlExtending the RewriteRule with the optional character / at the end of products strangely brings the "File Not Found" error message for both cases:
http://www.webpage.de/products
and
http://www.webpage.de/products/
.htaccess incorrect:
------------------------
Code: Select all
RewriteEngine on
RewriteRule ^.*/(.+)\.html$
RewriteRule /produkte/?$ http://www.webpage.de/products/maschinenbau/maschinenbau.html=> What am I doing wrong? Why can't I add the optional / at the end?
Thanks,
visionmaster