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]

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.