title: Catch all redirect
body: <p>This is the htaccess file. I'm wanting to add a catch-all 301 redirect RewriteRule. </p>
  
  <p>This is not working. Any ideas?</p>
  
  <pre><code>RewriteRule ^/(.*)$1 http://www.domain.co.uk/ [R=301,L]
  </code></pre>
  
  <p>Here are the rest of the rewrites. </p>
  
  <pre><code>enter coOptions +SymlinksIfOwnerMatch +MultiViews
  RewriteEngine On 
  RewriteBase /
  
  ### HTTP &gt; HTTPS &amp; 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 &amp; 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] 
  </code></pre>