Jump to content

[Resolved] 301 Redirect from old site problem.


violinman

Recommended Posts

I have setup several 301 redirects from my old site to the new site in the .htaccess file. The problem is they do not work because of a clash with the SEO Rewrite code in the .haccess file.

What seems to be happening is that the redirect does the correct thing in that it appends the correct url to the domain name but then the SEO Rewrite stuff adds the old URL to the end of that!

here is an example:

http://mysite.com/location.html?seo_path=page--location-map--location

The domain name is the same, the correct current page location.html has been added to the domain by the 301 redirect but then the SEO code has also added the old page (page--location-map--location) to the end?

Is their anyway to make sure the SEO Rewriting is disabled for the 301 block?

Many thanks,

Brian

Link to comment
Share on other sites

17 hours ago, violinman said:

What seems to be happening is that the redirect does the correct thing in that it appends the correct url to the domain name but then the SEO Rewrite stuff adds the old URL to the end of that!

Is their anyway to make sure the SEO Rewriting is disabled for the 301 block?

If your 301 ReWrites are written correctly and are located in the .htaccess file in the correct location, then they will work and other directives will not be processed.  How did you add these ?  The problem with giving advice on this type of thing is that there is no one simple solution that fits all and each hosting environment / hosting account configuration, can and often is different

Ian

Link to comment
Share on other sites

Hi Ian, thank you for your reply. I have made some progress but it is not an easy fix. The 301 redirects are written correctly, the problem seems to be that the new server uses NGINX which no longer recognises the .htaccess file, all of the .htaccess file redirects etc.. now need to be in the NGIX server configuration directives section. That is fine but I suspect the mod_rewrite module is not running and I cannot find a way to check it. running phpinfo.php no longer has the modules section.

Very frustrating!

Brian

Link to comment
Share on other sites

I have spoken too soon, the .htaccess file is being used but when I test it hoping that the 301 redirect will work it somehow gets in a mess with seo stuff.

In this example which throws a 404 error it has attempted to do a rewrite in that it has put the new page after the domain name but then also added the old page with seo_path in front!

http://mysite.com/about-us.html?seo_path=page--about-us--profile 

I am trying with a different .htaccess file with nothing in it but the 301 redirect and a different error handler, it still shows the 404 cubecart error as well, even though I have removed the error handling lines from the .htaccess! What is going on ? is it a cache problem? I have cleared cubecart's caches numerous times.

Brian

Link to comment
Share on other sites

Ok now working, I found a superb free 301 redirect generator that constructs the .htaccess code correctly, it will also do a batch convert which in my case was around 25 links.

I also removed the START v4 SEO URL BACKWARD COMPATIBILITY rewrite rules as they seemed to be causing issues with the new ones.

https://donatstudios.com/RewriteRule_Generator

Brian

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...