Added the rest of the posts
This commit is contained in:
parent
67242737ce
commit
1a806a00f2
66 changed files with 2063 additions and 1 deletions
24
source/_posts/2012-05-23-forward-domain-mod-rewrite.md
Normal file
24
source/_posts/2012-05-23-forward-domain-mod-rewrite.md
Normal file
|
@ -0,0 +1,24 @@
|
|||
---
|
||||
title: Forward one domain to another using mod_rewrite and .htaccess
|
||||
slug: forward-one-domain-another-using-modrewrite-and-htaccess
|
||||
tags:
|
||||
- .htaccess
|
||||
- Code
|
||||
- Drupal
|
||||
- Apache
|
||||
- mod_rewrite
|
||||
---
|
||||
Within the mod_rewrite section of your .htaccess file, add the following lines:
|
||||
|
||||
RewriteCond %{HTTP_HOST} ^yoursite\.co\.uk$
|
||||
RewriteRule (.*) http://yoursite.com/$1 [R=301,L]
|
||||
|
||||
This automatically forwards any users from http://yoursite.co.uk to http://yoursite.com. This can also be used to forward multiple domains:
|
||||
|
||||
RewriteCond %{HTTP_HOST} ^yoursite\.co\.uk$ [OR]
|
||||
RewriteCond %{HTTP_HOST} ^yoursite\.info$ [OR]
|
||||
RewriteCond %{HTTP_HOST} ^yoursite\.biz$ [OR]
|
||||
RewriteCond %{HTTP_HOST} ^yoursite\.eu$
|
||||
RewriteRule (.*) http://yoursite.com/$1 [R=301,L]
|
||||
|
||||
If any of the RewriteCond conditions apply, then the RewriteRule is executed.
|
Loading…
Add table
Add a link
Reference in a new issue