skip to Main Content

I have a URL in the following structure like

http://www.naturaflowers.com/100-fresh-cut-wholesale-flowers.html

I want to rewrite the URL like

http://www.naturaflowers.com/fresh-cut-wholesale-flowers.html

We used “ultimate SEO url Plugin” to generate SEO friendly URL. The old URL structure is /index.php?main_page=index&cPath=category_id . My htaccess code is as follows :

RewriteEngine On
RewriteBase /
RewriteRule ^(.*)-(.*).html$ index.php?main_page=index&cPath=$1&%{QUERY_STRING} [L]

The above mentioned plugin and this htaccess code rewrite
index.php?main_page=index&cPath=100 to
/100-fresh-cut-wholesale-flowers.html . And now I want to
/100-fresh-cut-wholesale-flowers.html rewrite to
/fresh-cut-wholesale-flowers.html everywhere in my website through
htaccess .

2

Answers


  1. RewriteRule ^(/?)d+-(.*)$ $1$2
    
    Login or Signup to reply.
  2. Have your rules like this:

    RewriteEngine On
    RewriteBase /
    
    RewriteRule ^[0-9]+-(.+?.html)$ /$1 [L,R=302,NC]
    
    RewriteRule ^(.+?).html$ index.php?main_page=index&cPath=$1 [L,QSA,NC]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search