![]() |
Need with XML htaccess rewrite
Hi guys
so my sitemap is currently under domain.com/sitemap/ I need for it to be domain.com/sitemap.xml How should htaccess look? Currently it looks like RewriteEngine On RewriteRule ^sitemap.xml/?$ index.php ty |
Code:
Options +FollowSymLinks |
Thank you. So now, i'm wondering if this is bad SEO redirect?????
So i had another dev do a redirect for me before > domain.com/sitemap/ was the url after > domain.com/sitemap.xml << developer made this link possible via htacess PROBLEM #1 domain.com/sitemap/ << if you visit this page it still EXISTS so developer made ANOTHER redirection via .htaccess domain.com/sitemap/ to domain.com/sitemap.xml PROBLEM #2 domain.com/sitemap/ KINDA exists... but HOW? step1: go to yahoo.com step2 go to to domain.com/sitemap/ it will redirect you to domain.com/sitemap.xml BUT if you press "BACK" button on navigation it will take you back to "sitemap.xml" when it should be YAHOO.com ?????? so, this bad redirect??????????????????????? |
Personally, I love to have my redirects placed as clean as possible. If the sitemap is available on both URLs, you don't have to worry.
I had to read about sitemap files to make sure my sitemaps are good, but my conclusion is this.. you are on the same domain, you can have as many sitemaps as you want, search engines simply record the URLs you have and that's it. Having two sitemaps, /sitemap/ and /sitemap.xml won't hurt you in any way in my opinion... What concerns me the most, is migrating from HTTP to HTTPS.. Google says, you don't need to change anything anywhere, set a redirect and you are good to go, as Google will notice the change and simply follow your redirects, however, since I re-added one of my websites as HTTPS, my traffic doubled, and google considers my "old site", the same website, with HTTP, as a bad site for some reason. The site, with HTTP, has thousands of URLs excluded from the search results, while the newly added, even without a sitemap, with HTTPS, is loved by google. Also, for some reason.. google will also ignore my robots.txt file here and there. Even if I have my redirect URLs set to /disallow/, there are many keywords ranking directly to sponsor through my URLs. It's like, searching for "GFY" and you receive my URL, in the top fckn 5 results, which is like "domain.com/go/gfy", which leads you to gfy.com with my affiliate link lol ps. I'm experimenting with lots of new ideas, and this somehow works. Not for long, for sure, but for now, google sends me free traffic on keywords I never even wanted to rank lol |
Quote:
Code:
Sitemap: https://domain.com/sitemap.xml |
Quote:
|
Quote:
Adding a php header to these type of pages, fixed it for me: header("X-Robots-Tag: noindex, nofollow", true); |
Sometimes I don't understand how it happens
|
Quote:
To prevent this, add something like this at the top of the page at /sitemap/index.php: if ($_SERVER[REQUEST_URI] === '/sitemap/index.php' || $_SERVER[REQUEST_URI] === '/sitemap/') { header("Location: http://$_SERVER[HTTP_HOST]/sitemap.xml",TRUE,301); die(); } It simply checks the current path. If the visited url contains "/sitemap/ " or "sitemap/index.php", force a redirect to yourdomain.com/sitemap.xml. |
All times are GMT -7. The time now is 07:21 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc