Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect or using mod_Rewrite (redirecting from one url to another)

Status
Not open for further replies.

ontheprairies

Technical User
Jan 19, 2005
2
CA
I want to redirect users of an old website with the url of to the new website with a url of
Redirect has not worked for me. I have tried looking at the documentation for mod_rewrite online but cannot make heads or tails of it. I have not found any mod_rewrite examples online that I could model my problem after either (even though there are many). Does anyone know how I can go about doing this or can suggest resources which offer a solution to this task? Anyone who could provide insight into solving this would be great!
 
Try this.. this works for me
Code:
<VirtualHost 207.158.23.98:80>
    DocumentRoot /[URL unfurl="true"]www/name1.name2.name3.com/name4/[/URL]
    ServerAdmin admin@name1.name2.name3.com
    ServerName [URL unfurl="true"]www.name1.name2.name3.com[/URL]
    ServerAlias name1.name2.name3.com
    CustomLog /[URL unfurl="true"]www/name2.com/name4/log/access_log[/URL] combined
    ErrorLog /[URL unfurl="true"]www/name2.com/name4/log/error_log[/URL]
 
    RewriteEngine On
    RewriteLogLevel 0
    RewriteLog /[URL unfurl="true"]www/name2.com/name4/log/rewrite_log[/URL]
    RewriteCond %{HTTP_HOST} name1.name2.name3.com
    RewriteRule ^(.*)$ [URL unfurl="true"]http://name2.com$1[/URL] [R]

    <Directory />
         Options ALL
         AllowOverride ALL
         Order allow,deny
         Allow from all
    </Directory>
</VirtualHost>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top