Jump to content

hi people, I have a URGENT PROBLEM, mod_rewrite, wrong place I know, please read


louis_coetzee

Recommended Posts

Hi,

 

Can someone please help me, I created a new topic this morning (I am in SA) no one has replied, this is the only place I ever get help, and I have an URGENT problem...unhappy customer.

Please don't move this topic.

 

I have a mod-rewrite rule, I am using routes on the website.....now google cannot access robots.txt or sitemap.xml

 

how can I allow access to these files in my root_dir??? Exclude them from the rule??

rule:

RewriteEngine On
RewriteRule !(\.gif|\.png|\.jpe?g|\.css|\.js|\.php|^public/.*)$ index.php [nocase,last]

Assuming you're using .htacess files, straight after 'RewriteEngine On' add:

 

RewriteRule ^(robots\.txt|sitemap\.xml) - [L]

 

If you have any more files or directories you can just add to that as well.

 

A quick look on Google would have found that out...

You could just add those file extensions...

 

RewriteRule !(\.gif|\.png|\.jpe?g|\.css|\.js|\.php|\.txt|\.xml|^public/.*)$ index.php [nocase,last]

 

OR the specific files

 

RewriteRule !(\.gif|\.png|\.jpe?g|\.css|\.js|\.php|robots\.txt|sitemap\.xml|^public/.*)$ index.php [nocase,last]

You could just add those file extensions...

 

RewriteRule !(\.gif|\.png|\.jpe?g|\.css|\.js|\.php|\.txt|\.xml|^public/.*)$ index.php [nocase,last]

 

OR the specific files

 

RewriteRule !(\.gif|\.png|\.jpe?g|\.css|\.js|\.php|robots\.txt|sitemap\.xml|^public/.*)$ index.php [nocase,last]

 

Thank you ppl, that solved it. I appreciate!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.