Log in

View Full Version : using .htaccess to allow robots.txt to be indexed! help!!


Michael.A
09-03-2011, 01:43 AM
trying to control domain using .htaccess not allowing it to view other then the folder is pointed to but in the sometime i want it to be allowed to only view robots.txt out side of the site folder dir!

exp:-

Allowed = domain.com/folder
Disallow = domain.com/

what am trying to do it:-

allowing = domain.com/robots.txt
and
Disallowing =domain.com/
Disallowing =domain.com/any thing but that folder

here is the htaccess code am using:

rewritecond %{HTTP_HOST} ^(www\.)?domain.com$ [NC]
rewritecond %{REQUEST_URI} !^/folder/
rewriterule ^(.*)$ "http://domain.com/folder/" [R=301,L]

Michael.A
09-05-2011, 01:48 AM
can some one move this to the Programming Discussions i post here not meaning to do so my bad..

no one is going to be able to help me here..

thanks wont happen again ...

Michael.A
09-16-2011, 06:59 PM
i got it working all u have to do is allow robots.txt

using ths code

rewritecond %{REQUEST_URI} !^/robots.txt