3
I have an example.com website that had a subdirectory called /lojanova.
This entire site has been migrated to the root of the main directory: "/".
For google there are still some images and files that are being directed to the wrong domain.
I would like to perform a 301 with htaccess so that all access made for example:
http://exemplo.com/lojanova/categoria/produto1.html
go to http://exemplo.com/categoria/produto1.html
It is possible?
Thank you in advance.
Strange, it still didn’t work. I need to have the old directory in question?
– Mateus Prado
I end up getting 404 saying that the page does not exist. In fact, it no longer exists. However, I would like to tell the request that it has been moved to another address.
– Mateus Prado
@Mateusprado you don’t need to have the old directory and these rewrite rules will exactly tell the request that "/lojanova/algo.html" has been moved to "/algo.html" and "/lojanova/categoria/product1.html" for "/category/product1.html" or any other variation. Did you check if mod_rewrite is enabled in your apache? post more details than you did.
– BrunoRB
Thanks for the quick Brunorb response. I checked with the hosting and they confirmed that mod_rewrite is active. As it is a shared hosting I do not have sudo access to make such a check. However, I created the htaccess file by copying and pasting what you recommended. I will take a server of mine and perform the tests to see if I have a different result and put here.
– Mateus Prado