apache - Remove / Rewrite 2 directory names from URL -


i need rewrite or redirect urls this:

http://www.mydomain.com/shop/product/keep-this-please

to

http://www.mydomain.com/keep-this-please

and htaccess in shop (magento) directory has this:

<ifmodule mod_rewrite.c>     options +followsymlinks     rewriteengine on     rewritebase /shop/  ## send 404 on missing files in these folders     rewritecond %{request_uri} !^/(media|skin|js)/  ## never rewrite existing files, directories , links     rewritecond %{request_filename} !-f     rewritecond %{request_filename} !-d     rewritecond %{request_filename} !-l  ## rewrite else index.php     rewriterule .* index.php [l] </ifmodule> 

how rewrite urls /shop/product/ in it?

insert line below rewritebase line:

rewriterule ^product/(.+)$ /$1 [l,r=302,nc] 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -