我有一个 .htaccess 发送这些网址:
http://example.com/this/is/test/
到 index.php 得到这样的 url:
index.php?var1=this&var2=is&var3=test
我想要做的就是改变/
to:
意味着 url 将是这样的:
http://example.com/this:is:test
就像以前一样将变量发送到索引页面。这是我的 .htaccess 文件:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/([^/]+)?/?([^/]+)?/?([^/]+)?/? [NC]
RewriteRule .* index.php?var1=%1&var2=%2&var3=%3 [L]