Boxerman Posted January 26, 2013 Share Posted January 26, 2013 Hi guys could someone just double check this for me please I need a fresh set of eyes. RewriteEngine On RewriteRule ^/admin /admin [L] RewriteRule ^/?watch/([a-z0-9-/]+)$ index.php?menu=watchmovie&perma=$1 [L] RewriteRule ^/?([a-z0-9-/]+)\.html$ index.php?menu=$1 [L] RewriteRule ^/?pages/([a-z0-9-/]+) index.php?menu=page&permalink=$1 [L] RewriteRule ^/?movies index.php?menu=movies [L] RewriteRule ^/?tv-shows index.php?menu=tv-shows [L] RewriteRule ^/?home index.php?menu=home [L] RewriteRule ^/?([a-zA-Z0-9-]+)/season/([0-9]+)/episode/([0-9]+)$ index.php?menu=episode&perma=$1&season=$2&episode=$3 [L] RewriteRule ^/?([a-zA-Z0-9-]+)/season/([0-9]+)$ index.php?menu=show&perma=$1&season=$2 [L] RewriteRule ^/?([a-zA-Z0-9-]+)$ index.php?menu=show&perma=$1 [L] Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/273653-whats-wrong/ Share on other sites More sharing options...
requinix Posted January 26, 2013 Share Posted January 26, 2013 What's wrong is you haven't told us the problem or what we should be looking for. Quote Link to comment https://forums.phpfreaks.com/topic/273653-whats-wrong/#findComment-1408306 Share on other sites More sharing options...
Boxerman Posted January 26, 2013 Author Share Posted January 26, 2013 Sorry I forgot. Basically you have to put /?home in order for it to work. It does not work when doing /home Quote Link to comment https://forums.phpfreaks.com/topic/273653-whats-wrong/#findComment-1408309 Share on other sites More sharing options...
Boxerman Posted January 26, 2013 Author Share Posted January 26, 2013 Please note this is the new code: RewriteEngine On Options +FollowSymlinks RewriteRule ^watch/([a-z0-9-/]+)$ index.php?menu=watchmovie&perma=$1 [L] RewriteRule ^([a-z0-9-/]+)\.html$ index.php?menu=$1 [L] RewriteRule ^pages/([a-z0-9-/]+) index.php?menu=page&permalink=$1 [L] RewriteRule ^movies/ /index.php?menu=movies [L] RewriteRule ^tv-shows index.php?menu=tv-shows [L] RewriteRule ^home index.php?menu=home [L] RewriteRule ^([a-zA-Z0-9-]+)/season/([0-9]+)/episode/([0-9]+)$ index.php?menu=episode&perma=$1&season=$2&episode=$3 [L] RewriteRule ^([a-zA-Z0-9-]+)/season/([0-9]+)$ index.php?menu=show&perma=$1&season=$2 [L] RewriteRule ^([a-zA-Z0-9-]+)$ index.php?menu=show&perma=$1 [L] Quote Link to comment https://forums.phpfreaks.com/topic/273653-whats-wrong/#findComment-1408310 Share on other sites More sharing options...
requinix Posted January 26, 2013 Share Posted January 26, 2013 Depending on a few things mod_rewrite may think the URL starts with a slash or not. Using ^/? is a good way to make sure that the rule works in both cases. Quote Link to comment https://forums.phpfreaks.com/topic/273653-whats-wrong/#findComment-1408316 Share on other sites More sharing options...
Boxerman Posted January 26, 2013 Author Share Posted January 26, 2013 I have tested both ways For example: If I got to test.com/home this shows a blank page But... If I go to test.com/?home this shows correctly. It's confusing me now. Quote Link to comment https://forums.phpfreaks.com/topic/273653-whats-wrong/#findComment-1408318 Share on other sites More sharing options...
requinix Posted January 26, 2013 Share Posted January 26, 2013 The question mark in the URL means something completely different than the question mark in the RewriteRule. The page you're testing now is the same page as test.com/index.php?home. Try going to test.com/?movies. Quote Link to comment https://forums.phpfreaks.com/topic/273653-whats-wrong/#findComment-1408324 Share on other sites More sharing options...
Boxerman Posted January 27, 2013 Author Share Posted January 27, 2013 As stated above the website works when goin to test.com/?movies but not when going to test.com/movies Quote Link to comment https://forums.phpfreaks.com/topic/273653-whats-wrong/#findComment-1408580 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.