My situation is as follows, and I’m sorry if this seems simple enough:
- we have created a new site, and combined 9 previous domains to one site.
- my previous first sites URL was http://www.example.com
- the url example.com has been forwarded to my new site, with a page for each previous domain, eg: http://www.newsite.com/location/example
- on visiting a previous page on example.com, eg: http://www.example.com/oldpage/ , you get dropped onto http://www.newsite.com/location/example/oldpage/.
- I would like to get some assistance on getting a redirect or rewrite rule in my .htaccess file that will allow me to remove the /oldpage/ from the URL on my new site.
I understand SEO practices, and practicality of this, I just need assistance in the .htaccess rule.
2
Answers
i found my answer in the following:
RewriteRule ^location/example/. /location/example/ [R=301,L]
Is this something like what you’re looking for?
It’s hard to discern what you’re trying to do from your question. Does the “location” part of the URL change?
Are you still showing the contents of
oldpage
at the new URL? Or are you wanting them to see the content athttps://www.newsite.com/location/example/
instead?