A lot of internal links in my forum that link back to the index go to this url /messageboard/index.php but I would prefer it to appear to go to /messageboard/ without the index.php bit as I want all the PR to go to that (if that makes a difference). Can this be done with mod_rewrite?
yes, but not necessary, simply modify DirectoryIndex in your httpd.conf: DirectoryIndex index.html index.htm index.php
I have index.php in the DirectoryIndex already but when people are linking specifically to http://www.xxx.com/messageboard/index.php it still shows up on the address bar that they went to /index.php I tried doing RewriteEngine on RewriteRule ^index.php$ http://www.xxx.com/messageboard/[R=301,L] But got an error.
Try this instead: RewriteEngine on RewriteRule ^messageboard/index.php$ http://www.xxx.com/messageboard/ [R=301,L] Code (markup): Can't you edit your forum code to not use index.php in it's links? It might be easier to go the other way, i.e. make all links point to index.php, even external ones. Cryo.
I guess I can but wanted to use mod_rewrite as it would be easier and quicker. I just want all my PR to go to /messageboard/ rather than index.php as /messageboard/ will probably be used more in external links.
yes, mod_rewrite can do that. But you can also try this in your index.php <?php header("location: http://www.xxx.com/messageboard/"); ?> It's even eaiser than using mod_rewrite