I've tried searching the forum for an answer, but have not had any luck.
I need to redirect all pages of an old site to the new site. The 2 sites have a different file structure, so I need all the hold pages to redirect to the homepage of the new site. Both sites are on the same hosting plan.
This is my .htaccess file, I've got it on the old site:
RewriteEngine On RedirectMatch 301 ^.+$ http://new-example.com/
The problem is that when redirecting from inner pages of the old site, the user gets sent to non-existant pages in the new site, like to from www.old-example.com/site/article.asp?AID=16 to newexample.com/?AID=16
I've tried various commands in the .htaccess but can't solve the problem, since I do not really know regular expressions, and I keep on fumbling it.
Any help would be greatly appreciated.
[edited by: jdMorgan at 4:28 pm (utc) on Feb 8, 2010] [edit reason] examplified [/edit]
RedirectMatch is a mod_alias directive, so the "RewriteEngine On" directive does nothing here.
However, I believe that the function that you need to clear the query string may require the use of mod_rewrite, so let's replace the RedirectMatch instead of removing the RewriteEngine directive: RewriteEngine on # RewriteRule ^.*$ http://new-example.co[b]m/?[/b] [R=301,L]