0

有没有办法让 modrewrite 忽略实际上不是基础的路径中的相同字符串?

我在我的 htaccess 文件中使用它:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /gallery/

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ index.php/$1
</IfModule>

效果很好。但我希望能够做类似的事情

somesite.com/gallery/view/(username)/gallery/(gallery-name)

它漂亮地重写了基础,但也去掉了路径中 /gallery/ 的第二个实例。有没有解决的办法?或者我应该修改我的路径结构以避免重复 rewritebase 吗?

谢谢, TE

4

0 回答 0