Home Catch all redirect
Reply: 0

Catch all redirect

user1395
1#
user1395 Published in April 26, 2018, 5:28 am

This is the htaccess file. I'm wanting to add a catch-all 301 redirect RewriteRule.

This is not working. Any ideas?

RewriteRule ^/(.*)$1 http://www.domain.co.uk/ [R=301,L]

Here are the rest of the rewrites.

enter coOptions +SymlinksIfOwnerMatch +MultiViews
RewriteEngine On 
RewriteBase /

### HTTP > HTTPS & non WWW to WWW version
# RewriteCond %{HTTPS} !on [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+(\S*)\sHTTP [NC]
RewriteRule ^ http://www.domain.co.uk/%1 [NE,L,R=301]

### index.php & index to root domain
RewriteRule ^index(?:\.php)? http://www.domain.co.uk/ [R=301,L]

### special rewrite rules for shortened urls ##
RewriteRule ^section(?:\.php)?/(.*)$ /s/$1 [R=301,L]
### To remove section page if 1 which is default for most (unless products span more)
RewriteRule ^s\.php/(.*)/1/(.*) /s/$1/$2 [R=301,L]
RewriteRule ^product(?:\.php)?/(.*)$ /p/$1 [R=301,L]
RewriteRule ^article(?:\.php)?/(.*)$ /a/$1 [R=301,L]
RewriteRule ^discount(?:\.php)/(.*)$ /d/$1 [R=301,L]

### Core Jshop .php removal
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*?)\.php/(.*)$ $1.php?$2 [L,QSA]de here

Redirect 301 /blog http://www.domain.co.uk/a/8/nursing-home-news/

RewriteRule ^/(.*)$1 http://www.domain.co.uk/ [R=301,L] 
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.302973 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO