I need to rewrite or redirect URLs like this:
to
and the htaccess in my shop (Magento) directory already has this:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /shop/
## always send 404 on missing files in these folders
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
## never rewrite for existing files, directories and links
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
## rewrite everything else to index.php
RewriteRule .* index.php [L]
</IfModule>
How do I rewrite just the URLs with the /shop/product/ in it?
将此行插入到RewriteBase行的正下方:
RewriteRule ^product/(.+)$ /$1 [L,R=302,NC]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.