301 Redirect Help-Need Regular Expression for Permalink Day and Name
Because this post had the day and name permalink structure I am getting a broken link 404 error for each date since the original post was published:
http://example,com/2011/13/07/postname
http://example,com/2011/14/07/postname
http://example,com/2011/15/07/postname and on and on and on over 60+ dates so far.
So I need to regular expression for the permalink structure so I can just to ONE 301 redirect for the post not one for each date. The plugin information indicates this can be done with regular expression and matching URLs:
Matching URLs
Matching a URL is a key part of Redirection and consists of a source URL. This URL must exactly match a URL that you want to redirect. For example, your site has the page:
http://yoursite.com/oldpage/that/needs/redirecting/ The source URL for this is: /oldpage/that/needs/redirecting/. The source does not require your website address, and it is only possible to redirect a URL that exists on your website (you cannot redirect an external website, for example).
Advanced users can make use of regular expressions to reduce the number of redirections they need to create. A regular expression is basically a pattern that tells the plugin how to match. For example:
/(\d*)/(\d*)/(.*) This pattern tells the plugin that you want to match a URL that looks like:
/2007/05/some-url/ That is, the (d*) indicates a number, and the (.*) a sequence of characters. Regular expressions are a complicated subject and this page will not attempt to give more than a passing overview of using them. If you do need more help then you should take a look at a regular expression website.
Remember that if the source URL is a regular expression then you must enable the regular expression option, otherwise Redirection will just treat you source URL as plain text.
In addition to the source URL you can also specify a match condition:
- URL only - Only matches the URL (the majority of your redirections will use this)
- URL and referrer - Matches a URL when the source and referring site matches (i.e. match the URL only when the user came from a certain website)
- URL and login status - Matches a URL when the source and user's login status matches (i.e. match the URL only when the user is logged in)
- URL and user agent - Matches a URL when the source and user's browser matches (i.e. when the user is using a particular type of web browser)
If anyone could assist me with the I would really appreciate. My site is starting to take a hit in the rankings because the 404 errors are getting out of control.
Thanks in advance for your assistance,
Kind regards,
Shawn
The best way to predict future is to create it ― Abraham Lincoln
Forever change the way you do Local SEO with Places Scout Software! Learn how you can easily make a lot more money, save a lot of time, and have happier clients. Click Here to Learn More...
The best way to predict future is to create it ― Abraham Lincoln
The best way to predict future is to create it ― Abraham Lincoln