302 Found error message

I have added a 301 redirect to the .htaccess of my Wordpress site but it's broken my site. It shows the following error message:

see link

.htaccess file

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^insurancetailors\.com$ [NC]
RewriteRule ^(.*)$ http://insurancetailors.co.uk[R=301,L]

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Answers


You need a space after the URL:

# here -----------------------------------------v
RewriteRule ^(.*)$ http://insurancetailors.co.uk [R=301,L]

Without the space, apache assumes you want to 302 redirect to the URL: http://insurancetailors.co.uk[R=301,L], which is not what you want, and is infact, throwing a 500 server error. Without the R=301 flag, apache assumes a 302 redirect.


EDIT:

Just to summarize comments:

i want to redirect insurancetailor.com to insurancetailor.co.uk

The rule needs to look like:

RewriteCond %{HTTP_HOST} ^insurancetailors\.com$ [NC]
RewriteRule ^(.*)$ http://insurancetailors.co.uk/$1 [R=301,L]

Try this code:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !^insurancetailors\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://insurancetailors.co.uk/$1 [R=301,L]

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Need Your Help

Android parse.com load relational objects

android parse-platform

Is it possible to load objects that are related in one API call? For example, I have two Classes: Post and Comment. In Post class I have relation that is one to many to Comment I want to load all P...

Error when installing visual studio 2005 on vista

visual-studio-2005 windows-vista

When install vs 2005 on windows vista it gives me the following error log .. what can I do??