seo and htaccess question

Discuss server installationa nd configuration issues here

Moderators: macek, egami, gesf

faust
New php-forum User
New php-forum User
Posts: 109
Joined: Thu May 03, 2012 7:22 am

seo and htaccess question

Postby faust » Sat May 19, 2012 12:12 pm

So, I made htaccess file to redirect anyone who enters my site from www.domain.com to www.domain.com/en/ (I have a multilanguage site). So, I submitted my robots.txt file to google webmasters. I have only this inside:

Code: Select all

User-agent: *
Allow: /
Disallow: /admin


But google webmasters say that it can't reach robots.txt and none of my 5600 pages are indexed... Does it have something to do with the redirect? It's not showing any other errors... I'll provide more info if you need. Thanks

User avatar
minimihi
New php-forum User
New php-forum User
Posts: 238
Joined: Sat Apr 14, 2012 11:57 am
Location: Vilnius, Lithuania

Re: seo and htaccess question

Postby minimihi » Sat May 19, 2012 1:41 pm

That will be probably htaccess fault.

If you're storing your robots.txt on www.domain.com, then when trying to access file you would get redirected to www.domain.com/en/robots.txt

If you're using htaccess to redirect to en folder, you would only need to move copy robots.txt.
If you're rewriting URL, you would need to add exceptions for your mod_rewrite

faust
New php-forum User
New php-forum User
Posts: 109
Joined: Thu May 03, 2012 7:22 am

Re: seo and htaccess question

Postby faust » Sun May 20, 2012 2:19 am

I tried adding the exceptions like this:

Code: Select all

RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ http://domain.com/en/ [R=301,L]
RewriteRule ^(.*)/$ /index.php?lang=$1
RewriteCond %{REQUEST_URI} !^/robots.txt$
RewriteCond %{REQUEST_URI} !^/sitemap.xml$


hope it works... I think I need to wait google a couple of days...


Return to “Server installation and configuration”

Who is online

Users browsing this forum: No registered users and 1 guest

cron