Reputation: 35
We have an online shop with a welcome page. Our SEO company has asked us to get rid of the welcome page with a rewrite as follows. i am struggling to get this to work. Can you help please?
rewrite www.domain.co.uk/catalog/index.php to become www.domain.co.uk, then 301 from www.domain.co.uk/catalog/index.php to www.domain.co.uk.
I have the following code which causes a redirect loop and nothing is displayed
RewriteRule ^/?$ catalog/index.php [L]
Redirect 301 /catalog/index.php http://www.domain.co.uk
Thanks in advance
Upvotes: 2
Views: 81
Reputation: 10247
How's that?
RewriteCond %{REQUEST_URI} /catalog/
RewriteRule .* / [L,R=301]
RewriteRule ^/?$ catalog/index.php [L]
If catalog is part of the browser request, a 301 will correctly redirect to /, which in turn will rewrite to catalog/index.php.
Upvotes: 0