Remove dates from post filenames

This commit is contained in:
Oliver Davies 2018-06-02 11:58:39 +01:00
parent 755db43747
commit 81597404c5
109 changed files with 110 additions and 11 deletions

View file

@ -0,0 +1,36 @@
---
title: Forward one domain to another using mod_rewrite and .htaccess
date: '2012-05-23'
slug: forward-one-domain-another-using-modrewrite-and-htaccess
tags:
- .htaccess
- code
- drupal
- apache
- mod_rewrite
use: [posts]
---
{% block excerpt %}
How to use the .htaccess file to forward to a different domain.
{% endblock %}
{% block content %}
Within the mod_rewrite section of your .htaccess file, add the following lines:
```language-apacheconf
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:
```language-apacheconf
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.
{% endblock %}