.htaccess nightmare - help
Posted by: martialarm
Posted on: 2005-07-16 22:15:00
I have been having problems setting up a good .htaccess redirect since moving from windows server to dreamhost.
I have .com and .co.uk and would like to .co.uk to 301 redirect to the .com
I think all the control panel directs are 302
the .co.uk is currently on a control panel point to the .com
Anyone got a better way???
Also had to change all my old pages over to .phtml
So need to 301 redirect all .html and .asp to new extension of .phtml.
This didnt work
...................
RewriteEngine ON
RewriteRule ^(.*)$ http://www.mypage.com/$1 [R=301,L]
.......................
(Redirection for this url exceeded)
is the error message
This one does work
RedirectMatch 301 (.*).html$ http://www.mypage.com$1.phtml
RedirectMatch 301 (.*).asp$ http://www.mypage.com$1.phtml
.......................
It covers the html, asp to phtml thing
BUT it doesnt allow any http://www.mypage.com
it converts to http://www.mypage.com/index.phtml
so this means EVERYTHING even http://www.mypage.com gets 301.
(I think this is not so good for my root and for all prior google links (why is www.mypage.com treated different that www.mypage.com/index.phtml ?)
#--------
Does anyone have a script that sends all 404 errors through a redirect to http://www.mypage.com
Errordocument 404 http://www.mypage.com used to work but not since I set up a database as it did something to the php and cgi not sure what?
It would be best to allow http://www.mypage.com to stay as it is (no automatic change to mypage.com/index.phtml) and does the .html & .asp transfer to corresponding pages in .phtml
#--------
With all these functions covered it would be perfect!
Hoping for help!
www.martialarm.com
The New Way To Train!