Domain Name Redirects
4 posts
• Page 1 of 1
Domain Name Redirects
Hello,
We are wanting to do something similar to this:
http://www.helicontech.com/forum/11901- ... older.html
We would like the root domain of ABC.com to redirect to 123.com, and have all other pages (except for 123.com and http://www.123.com/) redirect to XYZ.com. All of the website content was moved from ABC.com to XYZ.com, but the root domain (home page) should still go to 123.com.
Is this possible without having to manually define all of the specific exceptions for new content on XYZ.com? The overall configuration settings in our .htaccess file are listed below. Any assistance in this would be greatly appreciated. Thank you.
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.87
# unsupported directive: [ISAPI_Rewrite]
# 3600 = 1 hour
# unsupported directive: CacheClockRate 3600
# Block external access to the httpd.ini and httpd.parse.errors pages
RewriteRule ^/httpd(?:\.ini|\.parse\.errors).*$ [F,I,O]
# Block xml file access
# RewriteRule [^\.]*\.xml [F,I,O]
# Block external access to the Helper ISAPI Extension
RewriteRule ^.*\.isrwhlp$ [F,I,O]
thanks,
droid01
We are wanting to do something similar to this:
http://www.helicontech.com/forum/11901- ... older.html
We would like the root domain of ABC.com to redirect to 123.com, and have all other pages (except for 123.com and http://www.123.com/) redirect to XYZ.com. All of the website content was moved from ABC.com to XYZ.com, but the root domain (home page) should still go to 123.com.
Is this possible without having to manually define all of the specific exceptions for new content on XYZ.com? The overall configuration settings in our .htaccess file are listed below. Any assistance in this would be greatly appreciated. Thank you.
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.87
# unsupported directive: [ISAPI_Rewrite]
# 3600 = 1 hour
# unsupported directive: CacheClockRate 3600
# Block external access to the httpd.ini and httpd.parse.errors pages
RewriteRule ^/httpd(?:\.ini|\.parse\.errors).*$ [F,I,O]
# Block xml file access
# RewriteRule [^\.]*\.xml [F,I,O]
# Block external access to the Helper ISAPI Extension
RewriteRule ^.*\.isrwhlp$ [F,I,O]
thanks,
droid01
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Domain Name Redirects
Hello,
I'll try to fit it in as few rules as possible:
This should be located in global httpd.conf.
Regards
Andrew
I'll try to fit it in as few rules as possible:
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP:Host} ^(?:www\.)?abc\.com$ [OR]
RewriteCond %{HTTP:Host} ^(?:www\.)?123\.com$
RewriteRule .+ http://XYZ.com [NC,R=301,L]
RewriteCond %{HTTP:Host} ^(?:www\.)?abc\.com$
RewriteRule ^$ http://123.com [NC,R=301,L]
This should be located in global httpd.conf.
Regards
Andrew
Re: Domain Name Redirects
Hi Andrew,
Thank you for the quick response on this. We actually use a .htaccess file and not a global httpd.conf. The .htaccess is where all of our rewrite rules and redirects are placed. Will we need to make a separate httpd.conf, or should they go in the .htaccess?
thanks again,
droid01
Thank you for the quick response on this. We actually use a .htaccess file and not a global httpd.conf. The .htaccess is where all of our rewrite rules and redirects are placed. Will we need to make a separate httpd.conf, or should they go in the .htaccess?
thanks again,
droid01
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Domain Name Redirects
You can use these rules in separate .htaccess files:
to abc's .htaccess
to 123's .htaccess
Regards
Andrew
to abc's .htaccess
- Code: Select all
RewriteEngine on
RewriteRule .+ http://XYZ.com [NC,R=301,L]
RewriteRule ^$ http://123.com [NC,R=301,L]
to 123's .htaccess
- Code: Select all
RewriteEngine on
RewriteRule .+ http://XYZ.com [NC,R=301,L]
Regards
Andrew
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 19 guests