2

So I've redesigned a site that was built comprising of solely .asp pages and redid it using .html pages. I deleted the old site and uploaded the new, and uploaded my .htaccess file with code along the lines of:

Redirect 301 /studio.asp /studio.html

etc.

I was expecting that when I clicked on a google entry that it would redirect the old /studio.asp page to /studio.html but it doesn't? What am I doing wrong? I should say that I've tried to keep the filenames and old structure as much as possible the same in the redesign, but it's still showing the old .asp pages. Or have I missed something entirely here? Should my old site still be live in order for the redirects to work? Does it even matter that the old file extension is .asp? It is still sitting on the same URL as well.

  • 1
    What is your OS and web server? .htaccess is an Apache directive. Are you running Apache? – closetnoc Sep 16 at 1:41
  • in case you're running an Apache server you need to precise the full url like this : Redirect 301 /studio.asp https://example.com/studio.html. Anyway is this link what you're looking for ? – pjmg Sep 16 at 9:41
  • If this is the same server that was running the ASP pages then this is more likely to be IIS, not Apache. @pjmg Since Apache 2.2.6 you don't need to specify an absolute URL as the target. – MrWhite Sep 16 at 16:55
  • Oh good to know ty @MrWhite – pjmg Sep 16 at 18:32
  • 1
    @mhcoder36 The link provided above is for redirecting on a Windows/IIS/ASP server. You state you are now on a Linux server (assume Apache). And the domain (URL) remains the same. In that case, there is nothing seemingly wrong with the .htaccess directive posted - so why isn't this doing anything? Have you confirmed that .htaccess files are enabled on the server (although the host seems to imply they are)? Do you have any other directives in the .htaccess file? What happens exactly when you request /studio.asp? – MrWhite Sep 16 at 22:29
1

The response you are seeing for the old .asp pages would appear to be the standard 404 response on your server (or rather a front-end Nginx proxy by the looks). You seem to get the same response regardless of what non-existent page you request. So, this is not limited to .asp pages. This 404 response is a "domain holding" page with external third party adverts - which is not desirable, but maybe something which is forced on you by your host?

Edit: Whilst requesting other 404 pages I occasionally got a "502 Bad Gateway" or "503 Service Unavailable" response. This is also not desirable (and not normal).

You need to check with your host what is going on here.

You do not need the old site to be present in order to implement redirects from the old URLs. That is the whole point of an external redirect.

The host said that they "migrated the site to a linux server from a windows one ... so as to be able to use htaccess". This would imply you are being migrated to Apache (or perhaps LiteSpeed).

I assume this is a "shared" server. In which case .htaccess files should already be enabled.

If the .htaccess file exists in the document root of your site, then the Redirect directive you posted in the question, namely:

Redirect 301 /studio.asp /studio.html

really is all you require to redirect from /studio.asp to /studio.html.

If this is not happening, then again, you need to query this with your host.


UPDATE: My host provider reckons it's because I have the .rtf extension on the file as the file is enabled. The thing is, I deleted it on my desktop so it just shows .htaccess but it still shows as .htaccess.rtf when uploaded to the server. ... I've used TextEdit on the mac.

Yes, that is certainly a problem! If the file is called .htaccess.rtf on the server then it's simply never going to be processed by Apache and it won't do anything (which is the behaviour you are seeing - nothing). It must be called .htaccess - no more; no less with a dot as the first character. But also, it must not be formatted as an RTF (Rich Text Format) file. It must be "plain text", preferably UTF-8 encoded.

  1. Make sure that your Mac is displaying file extensions:
    https://www.idownloadblog.com/2014/10/29/how-to-show-or-hide-filename-extensions-in-os-x-yosemite/

  2. Make sure TextEdit is configured to edit plain text files:
    https://youtu.be/zCN75v4Bbdk

Recreate the file locally with the correct filename. Delete the incorrectly named file on the server and reupload!

(How did you edit and upload all the other files on your site?!)

  • I've just googled the site again and clicked on the studio link that appears and it's now going to the correct studio page! So I guess the redirects are working and that it just took a while to implement? Although I doubt it should take a week and a half should it? Either way, it's working, so thank you loads for helping me out. I really appreciate it. – mhcoder36 Sep 25 at 19:53
  • It's not working for me still - there are no redirects as far as I can see? Are you being redirected (check the network traffic in the browser), or are you clicking on the newly indexed /studio.html page in the SERPs? Request /studio.asp and you are not redirected - you just get the 404 Not Found page as mentioned above. The same for the other indexed pages... /aromatherapy.asp, /reiki.asp, /chakras.asp, etc. etc. You don't need Google to test this. Just request these pages directly in the browser. – MrWhite Sep 25 at 20:57
  • Thanks for your advice. I've raised this with my host and am now awaiting their response. – mhcoder36 Oct 1 at 17:38
  • 1
    My host provider reckons it's because I have the .rtf extension on the file as the file is enabled. The thing is, I deleted it on my desktop so it just shows .htaccess but it still shows as .htaccess.rtf when uploaded to the server. I've searched google for an answer to this but can't find one. I've used TextEdit on the mac. – mhcoder36 Oct 2 at 8:28
  • 1
    It's now working perfectly. I guess I never noticed it had the .rtf extension on the server as it looked right locally for me. I ended up using sublime text and deleting the extension which worked better than text edit. Anyway, thanks for all your help with this. – mhcoder36 Oct 3 at 8:54
-1

First of all, inspect your log files: what happens on accessing studio.asp?

I very suspect that to make the expected schema work you should maintain the previous IIS server too, so page like studio.asp really exist.

What else could happen? If my suspicion is wrong and with the server/file circumstances is everything ok, Googlebot could be a bit lazy and just don't crawl your redirect yet. That could be the cause, why you don't see an expected redirect if clicking studio.asp in SERP.

  • 1
    "Googlebot could be a bit lazy and just don't crawl your redirect yet. That could be the cause, why you don't see an expected redirect if clicking studio.asp in SERP" - this has nothing to do with whether Googlebot has crawled the redirect yet. The redirect occurs on the target site, not by Google. – MrWhite Sep 17 at 20:21
  • 1
    "I very suspect that to make the expected schema work you should maintain the previous IIS server too, so page like studio.asp really exist." - If you are implementing redirects, why would the old site need to exist? (By all accounts, the domain name has not changed.) – MrWhite Sep 17 at 20:22
  • @MrWhite this has nothing to do with whether Googlebot has crawled the redirect yet - surey it does. TS asks I was expecting that when I clicked on a google entry that it would redirect the old. If Gbot doesn't crawled it yet, or doesn't understand, then then old page remains in SERP. – Evgeniy Sep 23 at 10:52
  • But the main problem is that there is no working redirect for Gbot to crawl in the first place. If there was a working redirect in place on the website, then any user clicking an old result in the SERP would be redirected to the new URL - regardless of whether Gbot has crawled that redirect or not. – MrWhite Sep 23 at 17:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.