View Full Version : [SOLVED] - htaccess mod_rewrite file

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]

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

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