URL Rewrite ONLY html pages - redirect

OK ..I've used the common URL rewrite to redirect http to https.
Problem I'm seeing: Google crawls for sitemaps.xml and ads.txt and isn't happy.
Can someone help me with the http to https redirect for HMTL pages only so the .xml and .txt are ignored?
URL rewrite is Definitely my weakness.
IIS 7

Related

Google robots.txt for http site after redirection to https

The Google Robots.txt Specification states that a robots txt URL http://example.com/robots.txt is not valid for domain https://example.com. Presumably the reverse it also true.
It also has this to say about following redirects when requesting a robots.txt:
3xx (redirection)
Redirects will generally be followed until a valid result can be found (or a loop is recognized). We will follow a limited number of redirect hops (RFC 1945 for HTTP/1.0 allows up to 5 hops) and then stop and treat it as a 404. Handling of robots.txt redirects to disallowed URLs is undefined and discouraged. Handling of logical redirects for the robots.txt file based on HTML content that returns 2xx (frames, JavaScript, or meta refresh-type redirects) is undefined and discouraged.
Say I set up a website so that all requests on http are redirected permanently to equivalent on https. Google will request http://example.com/robots.txt and follow the redirect to https://example.com/robots.txt. Will this file be the valid robots.txt for the http site, because that was the original request, or will Google think there is no valid robots.txt for the http site?
Using the robots.txt tester in the Google Search Console confirmed that the redirected robots.txt is used as the robots file for the http (original) domain.
Answer provided by Barry Hunter on the webmaster central forum:
https://productforums.google.com/forum/#!topic/webmasters/LLDVaso5QP8

Google Crawler: Mark as Fixed is not helping

I migrated my site 2 years back (flash based to responsive). But Google crawler still complains that the old files are not reachable. Few times, I marked them fixed in the webmaster tools site. But still producing those errors. Some one mentioned in Google forum, just leave them as errors for a while and crawler marks itself these as obsolete after few attempts. This approach is also not helping. The site is a *nix GoDaddy-site with .htaccess file. Any ideas?
I think it will work if you set up an http re-write rule for your web server, defining the content as http 301, Moved Permanently. Then the crawl bot will start looking in the new place.
So, the bot request:
GET /index.php HTTP/1.1
Host: www.example.org
And the appropriate server response:
HTTP/1.1 301 Moved Permanently
Location: http://www.example.org/index.asp
I've done this with success before, on a forum site where we changed URL format after a year or so.
If the amount of links are not too big, you can redirect each and one of them by doing this in .htaccess:
Redirect 301 /old-page.html http://example.com/new-page.html
Redirect 301 /another-old-page.html http://example.com/another-new-page.html
And it seems that the mod_rewrite is enabled by default, so only type your redirects, and you're home free. When you've had them for a while, they can be taken away again.

301 Redirect w/ Parameters IIS web.config

I made an error in structuring my clients site such that I unnecessarily added a path that was not needed.
What I did was this:
www.mysite.com/vehicles/ford
www.mysite.com/vehicles/ford/fusion
I have since modified the site such that it now reads -
www.mysite.com/ford/
www.mysite.com/ford/fusion/
Needless to say that Google is now reporting well over 1600 bad urls, ie. 404.
I am using Godaddy shared hosting IIS, the site is done in classic ASP.
I have the web.config file figured out for the url rewrites on the second generation but am hoping to get some help with the 301 redirect. I hope I don't need 1600 redirects, but rather some code that takes anything with /vehicles/ (and after) and redirects to another page, say the home page.
Here is what I have tried but it just takes me to /vehicles/acura/

How to create dynamic 301 redirect urls

Is it possible to create dynamic 301 redirect urls ?
I have a dating site and the url format is like /dating/united_states_singles/. A few months ago, I changed it to /free-dating/united_states/ (added free and removed singles). When I checked on Google webmaster tool, both URLs (old and new) are indexed, which create duplicate title and description tags.
Is it possible to create 301 redirect for all old urls to new urls format?
If this is a windows IIS server url the url rewrite module
http://www.iis.net/downloads/microsoft/url-rewrite

I want to redirect the index.php from a Wordpress site to another URL, and all the other URLs in the WP site separatley

So, here is the problem:
I need to have a redirect from website.ro/ to website.com/
Website.ro is on wordpress.
At the same time, all the sub-links like website.ro/title will be redirected individually to website.com/different_title_same_content
If i do this:
Redirect 301 /index.php http://website.com/
Redirect 301 /title http://website.com/different_title_same_content
What happens is that website.ro is on wordpress, that means that all the sublinks are called through index.php (i think, but not sure) and if i do a redirect on index.php than all the other links will be redirected to the homepage and not to their corresponding innerpage.
Its like setting a master rule when i'm redirecting the index.php.
What i would like to do is redirect index.php to a homepage, and any other variation on its corresponding subpage on the new website.
Can it be done?
EDIT: I have added a little of the code that i have to write:
Redirect 301 /Zuzu newsite/portfolio/cases/doc/47860743/
Redirect 301 /Antena1 newsite/portfolio/cases/doc/47860862/
...and so on for allmost 100 urls. (i had to post here without http and www since i am not allowed here more than 2 urls)
The reason i have to do this is that in the past, many of the links on the oldsite appeared in articles, press, blogs and so on, and i do not want to loose traffic that the old links generated on each page.
At the same time, i want to redirect the homepage to the newsite homepage, but if i do this with:
Redirect 301 / newsite/
it will redirect all the other links to the main page of the newsite and not to its corresponding article.
Its the same if i do Redirect 301 /index.php newsite/
since the old website is on wordpress and i think that all the pages are called through index.php(and some variables)
Also, the urls on the newsite.com are not rewritable as to rename them as the old ones so i can create an automated redirect generally valid.
WHAT IS THERE TO DO?
Look into this it may solve your issue
http://enarion.net/web/htaccess/migrate-domains/
Best of luck!