.htaccess redirect issue

asked May 17, 2012 in General by TheRock (920 points)

I want to set up an .htaccess redirect so that all URLs for an account will be redirected. I need every incoming URL to redirect to the newdomain.com/subfolder/ URL.

I have the following HTML code in the site root .htaccess file:
Redirect 301 / http://www.newdomain.com/subfolder/
the redirect does not work correctly if the "incoming" URL is :


The redirect does occur, but it goes to URL:


And that creates an error 404, since that page does not exist on the newdomain.com website.

Can anyone help me fix this?


2 Answers

0 like 0 dislike
answered May 17, 2012 by WebProX (12,200 points)
hi there,
If there are no files on the old domain, you could use the 404 error document option to redirect the user for any URL, you could set up each error document type to cover all of the common errors.

Set up a 301 redirect .
Redirect 301 / http://www.newsite.com/
ErrorDocument 400 http://www.newsite.com/
ErrorDocument 401 http://www.newsite.com/
ErrorDocument 403 http://www.newsite.com/
ErrorDocument 404 http://www.newsite.com/
ErrorDocument 500 http://www.newsite.com/
0 like 0 dislike
answered May 17, 2012 by randy999 (4,520 points)