Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 ?


share|improve this question
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

1 Answer 1

up vote 0 down vote accepted

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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