i have a problem to redirect from subdirectory to new domain?? i do the following Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^newdomain.com [nc] rewriterule ^(.*)$ http://www.olddomain.com/subdirectory/$1 [r=301,nc] Redirect permanent / http://www.newdomain.com/ Code (markup): it redirects from http://www.olddomain.com/subdirectory Code (markup): to http://www.newdomain.com/subdirectory Code (markup): i want the redirection to the following http://www.newdomain.com Code (markup): i want the redirection to the home page not from a subdirectory to a subdirectory
The following code will probably work for you RedirectMatch 301 /subdirectory(.*) http://newdomain.com/$1 Code (markup):
really thank you it works like a charm i did add only that code at the .htaccess RedirectMatch 301 /subdirectory(.*) http://newdomain.com/$1 Code (markup): don't you think i should add something extra like that at the beging of the file... Options +FollowSymlinks RewriteEngine on Code (markup): sorry i have very little knowledge about .htaccess file configuration
just 1 modification to your code you must remove the backslash from the new domain instead to be like that RedirectMatch 301 /subdirectory(.*) http://newdomain.com/$1 Code (markup): to be like taht RedirectMatch 301 /subdirectory(.*) http://newdomain.com$1 Code (markup): becasue it adds one more slash after the domain name anyway I'm very thankful for your help