RewriteEngine On RewriteRule ^forums.* /index.php RewriteRule ^viewforum([0-9]*)-([0-9]*)-([0-9]*).* /viewforum.php?f=$1&topicdays=$2&start=$3 RewriteRule ^mforum([0-9]*).* /viewforum.php?f=$1&mark=topic RewriteRule ^forum([0-9]*).* /viewforum.php?f=$1 RewriteRule ^ptopic([0-9]*).* /viewtopic.php?t=$1&view=previous RewriteRule ^ntopic([0-9]*).* /viewtopic.php?t=$1&view=next RewriteRule ^newtopic([0-9]*).* /viewtopic.php?t=$1&view=newest RewriteRule ^ftopic([0-9]*)-([0-9]*)-([a-zA-Z]*)-([0-9]*).* /viewtopic.php?t=$1&postdays=$2&postorder=$3&start=$4 RewriteRule ^ftopic([0-9]*)-([0-9]*)-([0-9]*)-([a-zA-Z]*)-([a-zA-Z]*).* /viewtopic.php?t=$1&start=$2&postdays=$3&postorder=$4&highlight=$5 RewriteRule ^ftopic([0-9]*)-([0-9]*).* /viewtopic.php?t=$1&start=$2 RewriteRule ^ftopic([0-9]*).* /viewtopic.php?t=$1 RewriteRule ^sutra([0-9]*).* /viewtopic.php?p=$1 Code (markup): This is what I have in my .htaccess file but my forum pages dont work. http://www.must-have-software.net/forum/forum2.php I re-did the mod_rewrite mod but still does the same thing
Well the first thing i would say is more precise with the extensions try the folowing for each one RewriteRule ^ftopic([0-9]*).php$ /viewtopic.php?t=$1 [L] I aint no expert but i would say that it should work
I also had to add this to my page header.php in the includes folder ob_start(); function replace_mod_rewrite($s) { $urlin = array( "'(?<!/)viewforum.php\?f=([0-9]*)&topicdays=([0-9]*)&start=([0-9]*)'", "'(?<!/)viewforum.php\?f=([0-9]*)&mark=topics'", "'(?<!/)viewforum.php\?f=([0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&view=previous'", "'(?<!/)viewtopic.php\?t=([0-9]*)&view=next'", "'(?<!/)viewtopic.php\?t=([0-9]*)&view=newest'", "'(?<!/)viewtopic.php\?t=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&start=([0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)&postdays=([0-9]*)&postorder=([a-zA-Z]*)&highlight=([a-zA-Z0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)&start=([0-9]*)'", "'(?<!/)viewtopic.php\?t=([0-9]*)'", "'(?<!/)viewtopic.php\?p=([0-9]*)'"); $urlout = array( "viewforum\\1-\\2-\\3.php", "mforum\\1.php", "forum\\1.php", "ptopic\\1.php", "ntopic\\1.php", "newtopic\\1.php", "ftopic\\1-\\2-\\3-\\4.php", "ftopic\\1-\\2-\\3-\\4-\\5.php", "ftopic\\1-\\2.php", "ftopic\\1.php", "sutra\\1.php"); $s = preg_replace($urlin, $urlout, $s); return $s; } Code (markup):
Tried it and it doesn't work. But I can go to http://www.must-have-software.net/forum/viewforum.php?f=46 just fine...? (I typed it in to see...)
Try mod-rewrite*com/forum. I've had quite useful feedback and managed to get my mod rewrite problem resolved. Good luck...
Haven't really looked at the regex, but (just guessing), is the forum located in a sub-directory (e.g. somsite.com/forum/), and is the .htaccess file located in a higher directory? If so, add: RewriteBase path/to/forum Code (markup): Also check your apache error logs from a SSH shell: cat /var/log/httpd/error_log | tail Code (markup):