Skip to main content

Greg McVerry

Trying to write redirects in htaccess...any ideas

1 min read

So I need https://jgregorymcverry.com/how-to-add-read-post-types-to-known/ to go https://archive.jgregorymcverry.com/how-to-add-read-post-types-to-known/

the text string as url title is making the creation of redirects difficult how ever the backwards slash at the end gives me hope as webpages on my new site still end in .html.

I tried this:

 RewriteEngine On
RewriteRule https://jgregorymcverry.com/(.*)$/ https://archive.jgregorymcverry.com/$/ [R=301,L]
and this:
RewriteEngine On
RewriteRule https://jgregorymcverry.com/^(.*$/ https://archive.jgregorymcverry.com/$/ [R=301,L]

and this:

RewriteEngine On
RewriteRule https://jgregorymcverry.com/^$/ https://archive.jgregorymcverry.com/$/ [R=301,L]

and this:

RewriteEngine On
RewriteRule https://jgregorymcverry.com/$/ https://archive.jgregorymcverry.com/$/ [R=301,L]

None of these worked. I thought the syntax one was correct.  Any ideas?