![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Aug 2012
Posts: 929
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
So fuckin' bored
Industry Role:
Join Date: Jun 2003
Posts: 32,381
|
Code:
Options +FollowSymLinks RewriteEngine On RewriteRule ^sitemap.*$ https://domain.com/sitemap.xml [R=301,L]
__________________
Obey the Cowgod |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Aug 2012
Posts: 929
|
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??????????????????????? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Apr 2010
Posts: 1,084
|
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
So fuckin' bored
Industry Role:
Join Date: Jun 2003
Posts: 32,381
|
Quote:
Code:
Sitemap: https://domain.com/sitemap.xml Sitemap: https://domain.com/sitemap/ User-agent:* Disallow
__________________
Obey the Cowgod |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Apr 2010
Posts: 1,084
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Confirmed User
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
|
Quote:
Adding a php header to these type of pages, fixed it for me: header("X-Robots-Tag: noindex, nofollow", true); |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Industry Role:
Join Date: Jan 2022
Posts: 34
|
Sometimes I don't understand how it happens
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
|
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. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() ![]() |
|||||||
|
|||||||
Bookmarks |
Tags |
htaccess, domain.com/sitemap.xml, index.php, ^sitemap.xml/?$, rewriterule, rewriteengine, guys, rewrite, xml, domain.com/sitemap, sitemap |
Thread Tools | |