louis_coetzee Posted September 8, 2009 Share Posted September 8, 2009 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 https://forums.phpfreaks.com/topic/173532-hi-people-i-have-a-urgent-problem-mod_rewrite-wrong-place-i-know-please-read/ Share on other sites More sharing options...
Adam Posted September 8, 2009 Share Posted September 8, 2009 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 https://forums.phpfreaks.com/topic/173532-hi-people-i-have-a-urgent-problem-mod_rewrite-wrong-place-i-know-please-read/#findComment-914716 Share on other sites More sharing options...
ToonMariner Posted September 8, 2009 Share Posted September 8, 2009 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 https://forums.phpfreaks.com/topic/173532-hi-people-i-have-a-urgent-problem-mod_rewrite-wrong-place-i-know-please-read/#findComment-914719 Share on other sites More sharing options...
louis_coetzee Posted September 8, 2009 Author Share Posted September 8, 2009 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 https://forums.phpfreaks.com/topic/173532-hi-people-i-have-a-urgent-problem-mod_rewrite-wrong-place-i-know-please-read/#findComment-914740 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.