XGCommander Posted April 24, 2010 Share Posted April 24, 2010 Hello. I currently have a new system of articles in place on my dev server. I need to make it so that old article links still work so they need to redirect to the new article style and maintain the new url, not just having a simple redirect by changing the rules of the old article rewrite. Current (old) URL: http://www.explicitgamer.com/blog/2010/04/corrupted-by-games-yeah-right/ New (dev) URL: http://www.explicitgamer.com/article/corrupted-by-games-yeah-right So I need a rewrite rule that will redirect people from the old url to the new url. I've been trying but I just can't figure it out. This is probably due to my poor regex skills. Any help or resources would be most appreciated. Also, while i'm here. Is it better to have a trailing slash in urls (like the old one) or is the new one fine? Quote Link to comment https://forums.phpfreaks.com/topic/199589-rewrite-redirect-help-please/ Share on other sites More sharing options...
cags Posted April 25, 2010 Share Posted April 25, 2010 You'd want something like... RewriteRule ^blog/[0-9]+/[0-9]+/([a-zA-Z0-9-]+)/? /article/$1 [R=301] The trailing slash doesn't really make any different so far as I know, it's just a personal preference. Quote Link to comment https://forums.phpfreaks.com/topic/199589-rewrite-redirect-help-please/#findComment-1047912 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.