Jump to content

Mod_Rewrite


Chud37

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.