Jump to content

301 Redirects


LaughingHorse

Recommended Posts

I have been going round and round on this one and hopefully there is an expert in mod_rewrites who can answer this.

My site is structured with top level (lets call it root) pages all with a .php extension

e.g. https://mysite.com/anypage.php (there are around 100 pages like this)

I have moved to a wordpress site, as a sub folder of root, and CubeCart as a subfolder as root

In my wordpress site, I have duplicated the text of the .php pages. A lot of the pages rank really high in the search engines for their terms. And I don't want to lose that ranking.

I know there is a way to redirect an entire site from one domain to another with 301 redirects.

And there is a way to redirect root pages to a subfolder with 301 redirects.

For example I found this

# Redirect domain.com to domain.com/folder/

Example Below…

RewriteEngine On
RewriteRule ^$ /blog/ [R=301]

# end redirect

 

With /blog/ being the sub folder. The problem, is it keeps the .php extension and I would like to strip that away.

WordPress will not let me add extensions so the pages end up showing

https://mysite.com/wp/anypage

Can someone help me with this?

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...