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.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-13-2022, 09:25 AM   #1
lakerslive
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
lakerslive is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-13-2022, 10:09 AM   #2
just a punk
So fuckin' bored
 
just a punk's Avatar
 
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
just a punk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-15-2022, 08:53 AM   #3
lakerslive
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???????????????????????
lakerslive is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-15-2022, 03:57 PM   #4
zerovic
Confirmed User
 
zerovic's Avatar
 
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
zerovic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-15-2022, 04:33 PM   #5
just a punk
So fuckin' bored
 
just a punk's Avatar
 
Industry Role:
Join Date: Jun 2003
Posts: 32,381
Quote:
Originally Posted by zerovic View Post
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.
Yep. The OP may also put this in his robots.txt:

Code:
Sitemap: https://domain.com/sitemap.xml 
Sitemap: https://domain.com/sitemap/
User-agent:*
Disallow
__________________
Obey the Cowgod
just a punk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-15-2022, 04:47 PM   #6
zerovic
Confirmed User
 
zerovic's Avatar
 
Industry Role:
Join Date: Apr 2010
Posts: 1,084
Quote:
Originally Posted by CyberSEO View Post
Yep. The OP may also put this in his robots.txt:

Code:
Sitemap: https://domain.com/sitemap.xml 
Sitemap: https://domain.com/sitemap/
User-agent:*
Disallow
And there's nothing to worry about in my opinion.
zerovic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-15-2022, 05:55 PM   #7
zijlstravideo
Confirmed User
 
zijlstravideo's Avatar
 
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
Quote:
Originally Posted by zerovic View Post
Also, for some reason.. google will also ignore my robots.txt file here and there.
Yeah, seen this happen a few times as well. Even for pages for which it didn't make any sense to get indexed at all, like you've mentioned, outgoing redirect pages and such...

Adding a php header to these type of pages, fixed it for me:
header("X-Robots-Tag: noindex, nofollow", true);
__________________
Contact: email
zijlstravideo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-16-2022, 03:56 AM   #8
FansCity
Confirmed User
 
FansCity's Avatar
 
Industry Role:
Join Date: Jan 2022
Posts: 34
Sometimes I don't understand how it happens
FansCity is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-16-2022, 05:02 AM   #9
zijlstravideo
Confirmed User
 
zijlstravideo's Avatar
 
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
Quote:
Originally Posted by lakerslive View Post
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?
If the old url (/sitemap/index.php) is a real path, then yes, you would also still be able to access it directly at /sitemap or /sitemap/index.php.

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.
__________________
Contact: email
zijlstravideo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
htaccess, domain.com/sitemap.xml, index.php, ^sitemap.xml/?$, rewriterule, rewriteengine, guys, rewrite, xml, domain.com/sitemap, sitemap
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.