0

I changed the URL of my articles so I need to be able to redirect them all, but this is how I had it set before in htaccess:

RewriteRule ^industry/([a-zA-Z0-9-]+).([0-9]+)/$ index.php?tag=industry&slug=$1&id=$2

Which would give me something like:

site.com/industry/blah-blah.6842/

Now with my new site, I have the URLs set like this:

site.com/blah-blah/

So how I can do a 301 redirect in htaccess? I can't do all the articles individually because there's tons of them.

I need to be able to redirect this:

^industry/([a-zA-Z0-9-]+).([0-9]+)/$ to this: ^/([a-zA-Z0-9-]+)/$

Thanks in advance.

1 Answers1

1

RewriteRule ^industry/([a-zA-Z0-9-]+).([0-9]+)/$ /$1/ [R=301]

Maxym
  • 659
  • 5
  • 11
  • Yes, that works great. I didn't mention that I moved to Wordpress so I had trouble, but I added it to the htaccess above the Wordpress #begin and it works now. Thanks! –  Sep 30 '14 at 15:36