Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This issue is on Wordpress site.

I am aware we can change the URL naming convention in WP but i have changed my url format from date format to simple postname followed by slug as shown below.

old style


new style


Google previously indexed my websites pages (sitemap.xml) with below format:


I have resubmitted the sitemap but there are still 404 errors in Google/Bing engine.

Could you please help me to write 301 redirects rule in .htaccess file so when some clicks the URL for:


They should be redirected to:


How we can write rule in .htaccess file to remove date part 2013/02/09/?

I tried something like this (Googled it ), but didnt worked

RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d

share|improve this question
What have you tried? – John Conde Jun 28 '13 at 12:14

RewriteEngine On

RewriteBase /

RewriteRule ^([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ /$4 [R=301,NC,L]

share|improve this answer
RewriteEngine On
RewriteRule ^(\d+/){3}(.*)$ /$2 [R=301]

This will strip any sequence of 3 numbers each followed by slashes (so it will work with short year dates like YY/MM/DD dates or single digit days/months like 2013/2/9. If you want to keep the date in the url and have it silently redirect to the correct page without the user knowing, lose the [R=301]

share|improve this answer
also, is this for a wordpress site? If so it would be better to manage your url naming within the wordpress options than to go writing your own htaccess rules. – WebChemist Jun 28 '13 at 10:09
Hi WebChemist , Really thankful giving an idea how to implement it. I tried your suggestion but Url its was returning as www.domain.com/ringdroid/02/09/rin​gdroid. so i have implemented my below own code and here it is. – user2131844 Jun 29 '13 at 0:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.