Jump to content

Rewrite redirect help PLEASE.


XGCommander

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.