AaronBE
07-17-2011, 09:28 PM
Hello.
I want to redirect all the incorrect calls of a web to the main page. Correct calls must be works as normally.
I have this sctucture:
www.domain.com
-en/
--index.php (main page)
--...
-images/
--logo.gif
--...
-sitemap.html
-robots.txt
A call to www.domain.com/sitemap.html must show the sitemap.html
A call to www.domain.com/en/something must show something
Same with images/ an robots.txt
Calls to www.domain.com/mistaken_uri must be redirected 301 to www.domain.com/en/index.php
I've tried with:
RewriteCond %{REQUEST_URI} !^(sitemap\.html|robots\.txt|en|images)
RewriteRule ^(.*)$ http://www.domain.com/ca/index.php [R=301,L]
But it doesn't work.
Any idea?
I want to redirect all the incorrect calls of a web to the main page. Correct calls must be works as normally.
I have this sctucture:
www.domain.com
-en/
--index.php (main page)
--...
-images/
--logo.gif
--...
-sitemap.html
-robots.txt
A call to www.domain.com/sitemap.html must show the sitemap.html
A call to www.domain.com/en/something must show something
Same with images/ an robots.txt
Calls to www.domain.com/mistaken_uri must be redirected 301 to www.domain.com/en/index.php
I've tried with:
RewriteCond %{REQUEST_URI} !^(sitemap\.html|robots\.txt|en|images)
RewriteRule ^(.*)$ http://www.domain.com/ca/index.php [R=301,L]
But it doesn't work.
Any idea?