Your .htaccess syntax are same as what i’m using but it work for me. I think it’s because of your robots.txt url have been cached. Please delete cache and check again or please send your complete htaccess.
Hi, here is my .htaccess. It has a seo-friendly url mod from cdseo pro for x-cart.
Also, how would I go about un-caching the robots.txt file? Is there any way to disable its caching?
# ------------------------------------
# CDSEO Pro
# ------------------------------------
# This directory index is recommended to replace the
# x-cart default within this .htaccess file
DirectoryIndex home.php index.html index.php
# Enable mod rewrite engine
RewriteEngine On
Options +FollowSymLinks
Options +Indexes
RewriteCond %{HTTP_HOST} ^www\\.buy-replica\\.([a-z]+[a-z\\.]*)$ [NC]
RewriteRule ^robots\\.txt$ robots_%1.txt [L]
RewriteCond %{HTTP_HOST} ^buy-replica\\.com [NC]
RewriteRule .? http://www.buy-replica.com%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteRule ^(.*)\\.asp http://www.buy-replica.com/ [R=301,L]
RewriteRule ^(.*)\\.aspx http://www.buy-replica.com/ [R=301,L]
RewriteCond %{HTTP_HOST} ^buy-replica\\.com [NC]
RewriteRule ^(.*)$ http://www.buy-replica.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^buy-replica\\.ru [NC]
RewriteRule ^(.*)$ http://www.buy-replica.ru/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^buy-replica\\.de [NC]
RewriteRule ^(.*)$ http://www.buy-replica.de/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^buy-replica\\.fr [NC]
RewriteRule ^(.*)$ http://www.buy-replica.fr/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^buy-replica\\.es [NC]
RewriteRule ^(.*)$ http://www.buy-replica.es/$1 [L,R=301]
# .htpasswd protection
# May be required if your htpasswd files are located below document root (i.e. cpanel)
# Remove # at the beginning of this line if your unable to access password protected folders:
ErrorDocument 401 "Unauthorized"
# Some servers require this Options directive to be disabled
# Remove # at the beginning of this line to disable:
#Options -Multiviews
# Some servers require the Rewritebase directive to be enabled
# Remove # at the beginning of this line to enable:
#RewriteBase /
RewriteCond %{REQUEST_URI} !^/(payment|admin|provider|partner)/
RewriteCond %{REQUEST_FILENAME} !\\.(gif|jpe?g|png|js|css|swf|php|ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ cdseopro.php
# ------------------------------------
# / CDSEO Pro
# ------------------------------------
# ------------------------------------
# CDSEO Pro
# ------------------------------------
# This directory index is recommended to replace the
# x-cart default within this .htaccess file
DirectoryIndex home.php index.html index.php
# Enable mod rewrite engine
RewriteEngine On
Options +FollowSymLinks +Indexes -MultiViews
RewriteRule \\.aspx?$ http://www.buy-replica.com/ [R=301,L]
RewriteCond %{HTTP_HOST} !^www\\. [NC]
RewriteRule .? http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTP_HOST} ^www\\.buy-replica\\.([a-z]+[a-z\\.]*)$ [NC]
RewriteRule ^robots\\.txt$ robots_%1.txt [L]
# .htpasswd protection
# May be required if your htpasswd files are located below document root (i.e. cpanel)
# Remove # at the beginning of this line if your unable to access password protected folders:
ErrorDocument 401 "Unauthorized"
RewriteCond %{REQUEST_URI} !^/(payment|admin|provider|partner)/
RewriteCond %{REQUEST_FILENAME} !\\.(gif|jpe?g|png|js|css|swf|php|ico)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ cdseopro.php
# ------------------------------------
# / CDSEO Pro
# ------------------------------------
I’ve removed RewriteBase / because you usually don’t need it. If this breaks the complete .htaccess – it does on a small percentage of hosts – please put it back.
As for clearing the cache, I know there is a way – using mod_headers I think – but I’m not really sure how.
Thank you very much for optimizing the code! I’m 100% sure it should work, but the same is happening since post #1… Any suggestions where I should look to find the problem?