i tried to permanent redirect 301 from http://example.com to http://example1.com

RewriteEngine On
Options +FollowSymLinks

RewriteCond %{HTTP_HOST} ^test\.example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.test\.example\.com$
RewriteRule ^submitticket\.php\/?(.*)$ "http\:\/\/test\.example1\.com\/contact\.php$1" [R=301,L]

RewriteCond %{HTTP_HOST} ^test\.example\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.test\.example\.com$
RewriteRule ^/?$ "http\:\/\/manage\.example1\.com\/" [R=301,L]

but if i set any link like http://example.com/index.php to http://example1.com/index.php it won't redirect

so how can i made a permanent redirect files with all extensions and directory included ?

thanks

link|improve this question

20% accept rate
Is the intent to just redirect for submitticket.php and /, or all links? The config you have will just do those two specific locations. – Shane Madden Dec 27 '11 at 4:06
feedback

1 Answer

Create a separate vhost for example.com and put this in the config file:

ServerName example.com
Redirect permanent / http://example1.com/

Remember the trailing slash. This will redirect any request to the other domain, including subfolders, files and such.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.