我是regex
和mod-rewrite
的新手,我正试图解决这条道路:
http://127.0.0.1/projects/wp-deal/media/resizer/710x475/r/127.0.0.1/projects/wp-deal/wp-content/uploads/2014/12/photo.png
所以它变成了:
http://127.0.0.1/projects/wp-deal/wp-content/uploads/2014/12/photo.png
这是我到目前为止所尝试的内容:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /projects/wp-deal/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /projects/wp-deal/index.php [L]
</IfModule>
答案 0 :(得分:0)
在您的文档根目录中的htaccess文件中,尝试添加:
RewriteEngine On
RewriteRule ^projects/wp-deal/media/resizer/[^/]+/r/[^/]+/(projects/wp-deal.*)$ /$1 [L]