Robert Granlund
asked on
htaccess page redirect
I want to redirect a page on my website using a htaccess file. I want everything in the insight directory, no matter what type of page or folder contained in the folder to redirect. I don not belive I have written my htaccess file correct. This is what I have so far:
redirect http://www.MYSIGHT.com/insight/ http://dev.MYSITE.com/index.php/practice/listings/
ASKER
That works ok, but not all the way.
if I type in www.MYSITE,com/insight/index.php
the redirect should send it to:
http://dev.MYSITE.com/index.php/practice/listings/
but right now it sends it to:
http://dev.MYSITE.com/index.php/practice/listings/index.php/
In the new folder there is NOT an index.php, I have an index.html
It also adds a backslash to the very end that I don't won't.
This is what I have so far:
if I type in www.MYSITE,com/insight/index.php
the redirect should send it to:
http://dev.MYSITE.com/index.php/practice/listings/
but right now it sends it to:
http://dev.MYSITE.com/index.php/practice/listings/index.php/
In the new folder there is NOT an index.php, I have an index.html
It also adds a backslash to the very end that I don't won't.
This is what I have so far:
RewriteRule ^insight(.*)$ http://www.MYSITE.com/index.php/practice_career/od-listings
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Looks like the only real difference between what you have and my code is that I included "[L,R=301]" at the end which tells the browser that it is a 301 redirect.
Please post a couple examples of what does and does not work with your current rule so I can get a feel for what might be missing...
e.g.,
subdirectory redirects: /insight/folder1/page.php redirecting to "..."
page redirects: /insight/index.php redirecting to "..."
and any others that may not be working right
Please post a couple examples of what does and does not work with your current rule so I can get a feel for what might be missing...
e.g.,
subdirectory redirects: /insight/folder1/page.php redirecting to "..."
page redirects: /insight/index.php redirecting to "..."
and any others that may not be working right
ASKER
It is re-directing the folder fine, but it is holding onto everything after the folder redirect and tacking it on to the end of the new url.
It is including the page and subfolder names even after removing the $1 from the redirect?
ASKER
yes it is.
You'll want to change the value of "NewLocationHere"
Open in new window