...

View Full Version : [SOLVED] - htaccess mod_rewrite file



conware
03-23-2011, 07:16 PM
Hi guys Im trying to rewrite my news.php to news/ as if its a directory.
But the problem is when I rewrite it like that and someone removes the /
The page will display a 404 message now this seems right sins I did rewrite it to news/ but how would I be able to still display it when someone removes that /

This is my htaccess code so far.
Thanks for the help.



<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^news/$ news.php [L]
</IfModule>

Fou-Lu
03-23-2011, 07:22 PM
Add a ? after the /. That makes it optional.

conware
03-23-2011, 07:29 PM
Thanks for the tip Fou-Lu. works like a charm :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum