Chud37 Posted March 29, 2012 Share Posted March 29, 2012 hello; I have the following .htaccess file: Options +FollowSymlinks RewriteEngine on RewriteOptions MaxRedirects=10 AddType "text/html; charset=UTF-8" html AddType "text/plain; charset=UTF-8" txt RewriteRule ^series/([^/]+)/([^/]+)$ "http://www.mydomain.com/index.php?language=$1&m=$2" [NC] RewriteRule ^play/([^/]+)$ "http://www.mydomain.com/index.php?p=$1" [NC] RewriteRule ^browse$ "http://www.mydomain.com/browse.php" [NC] RewriteRule ^browse/$ "http://www.mydomain.com/browse.php" [NC] RewriteRule ^help$ "http://www.mydomain.com/help.php" [NC] RewriteRule ^help/$ "http://www.mydomain.com/help.php" [NC] We have recently moved servers, and this .htaccess file was working fine on our old server but now moving over and using the above .htaccess file it seems to be doing something different. For instance, If I goto www.mydomain.com/browse - I should be redirected to browse.php, and the user shouldn't know any better. The browser is doing the first part right, it redirects it to the correct page, but it is not hiding the browse.php from the address bar in the clients web-browser. So the redirects are working, but it is also giving away our pages aswell. If a user goes to www.mydomain.com/series/english/my-series, I DONT want them to see www.mydomain.com/index.php?language=english&m=my-series can someone help please? Its a new server I have WHM access and Cpanel obviously. What can it be? ~Chud37 Quote Link to comment https://forums.phpfreaks.com/topic/259946-mod_rewrite/ Share on other sites More sharing options...
Chud37 Posted March 29, 2012 Author Share Posted March 29, 2012 Topic solved, after much frustration. The answer was to NOT use http://www.mydomain.com and just use index.php. So now my .htaccess file looks like: Options +FollowSymlinks RewriteEngine on RewriteOptions MaxRedirects=10 AddType "text/html; charset=UTF-8" html AddType "text/plain; charset=UTF-8" txt RewriteRule ^series/([^/]+)/([^/]+)$ "index.php?language=$1&m=$2" [NC] RewriteRule ^play/([^/]+)$ "index.php?p=$1" [NC] RewriteRule ^browse$ "browse.php" [NC] RewriteRule ^browse/$ "browse.php" [NC] RewriteRule ^help$ "help.php" [NC] RewriteRule ^help/$ "help.php" [NC] Hope this helps anyone. Quote Link to comment https://forums.phpfreaks.com/topic/259946-mod_rewrite/#findComment-1332367 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.