In .htaccess of how to redirect urls after removing a word as a new structure applied

i have a WordPress site and recently i have changed the URLs structure and that cause a lot of NOT found errors as i found at google WebMaster tools
the old URL looks like that

http://www.akhbaralan.com/date/2014/01/page/76/

Read More

and i want it to look like that

http://www.akhbaralan.com/2014/01/page/76/

removing the word and redirect the URL to the one without the word

date

after the domain name
i searched a lot here in Stack Overflow and googled for it
but nothing have worked
i tried the the follwing

RewriteEngine On

RewriteRule ^date/(.*)$ http://www.akhbaralan.com//$1 [R=301,L]

RewriteRule ^date/(.*)$ /$1 [L,R=301,QSA]

RewriteRule ^date/(.*)$ /$1 [L,R=301]

RewriteRule ^(.*)/date/(.*)$ $1/$2 [R=301,L]

RewriteRule ^date/(.*)$ /$1 [L]

here is the full .htaccess file code and i have placed it at the home directory

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
# edirect cateories 3/4/2014
redirect 301 /cat8 /?cat=8
redirect 301 /cat3 /?cat=3
redirect 301 /cat2 /?cat=2
redirect 301 /cat4 /?cat=4
redirect 301 /cat5 /?cat=5
redirect 301 /cat7 /?cat=7
# nor found http://www.akhbaralan.com/date/2014/01/page/76/
# 7/7/2014
RewriteEngine On
RewriteRule ^date/(.*)$ http://www.akhbaralan.com//$1 [R=301,L]

Related posts

Leave a Reply

1 comment

    1. Keep your 301 rules before WP default rules
    2. Don’t mix mod_rewrite rules with mod_alias ones

    Your revised .htaccess:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    RewriteRule ^date/(.*)$ http://www.akhbaralan.com/$1 [R=301,L]
    
    RewriteRule ^cat([0-9]+)/?$ /?cat=$1 [L,QSA,R=301,NC]
    
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress