unemployment Posted August 22, 2011 Share Posted August 22, 2011 I am using this rewrite rule in my htaccess. RewriteRule ^blog/([0-9]+)/.*$ /blog.php?post_id=$1 [L] For some reason when I go to create a sitemap via http://www.xml-sitemaps.com/ It spiders pages that don't exist and keeps add pages to the url in the wrong way... for example... mysite.com/blog/5/blog-title is a real url mysite.com/contact is a real url mysite.com/blog/5/blog-title/contact is NOT a real url Is the rewriterule causing the issue? I just want to make sure google's spiders don't have the same problem. Quote Link to comment https://forums.phpfreaks.com/topic/245429-rewrite-causes-sitemap-spider-to-fail/ Share on other sites More sharing options...
requinix Posted August 22, 2011 Share Posted August 22, 2011 What's the HTML for the contact link? If it's relative like href="contact" then that's a problem - it needs to be absolute like href="/contact". Quote Link to comment https://forums.phpfreaks.com/topic/245429-rewrite-causes-sitemap-spider-to-fail/#findComment-1260631 Share on other sites More sharing options...
unemployment Posted August 22, 2011 Author Share Posted August 22, 2011 What's the HTML for the contact link? If it's relative like href="contact" then that's a problem - it needs to be absolute like href="/contact". I have made all of my links absolute, but I still get the error. Quote Link to comment https://forums.phpfreaks.com/topic/245429-rewrite-causes-sitemap-spider-to-fail/#findComment-1260632 Share on other sites More sharing options...
requinix Posted August 22, 2011 Share Posted August 22, 2011 Either the spider is trying URLs you aren't linking to (which is possible but nothing you can control) or there is still a href=contact link somewhere. Is your site somewhere we can see it? Quote Link to comment https://forums.phpfreaks.com/topic/245429-rewrite-causes-sitemap-spider-to-fail/#findComment-1260649 Share on other sites More sharing options...
requinix Posted August 22, 2011 Share Posted August 22, 2011 While I do see a few relative links at the site you PMed me, none of them are for the contact page. I think the spider may be "at fault", but I use the term loosely: it may be caching pages and it just hasn't refreshed since you've made changes (since I don't know when). To answer the question, the URL rewriting shouldn't affect any of that so long as you use absolute URLs. Wait a day or two and try their sitemap thing again, see if the problem magically disappears. Quote Link to comment https://forums.phpfreaks.com/topic/245429-rewrite-causes-sitemap-spider-to-fail/#findComment-1260653 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.