我想转:
/1/2
成:
/negocio/2.php?shopURL=1
我对htaccess知之甚少,我的规则不起作用。这就是我试过的:
RewriteRule ^([^/]+)(/.+)? /negocio$2.php/?shopURL=$1 [L,QSA]
答案 0 :(得分:1)
通过httpd.conf
启用mod_rewrite和.htaccess,然后将此代码放在.htaccess
目录下的DOCUMENT_ROOT
中:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^ - [L]
RewriteRule ^([^/]+)(/.+?)/?$ negocio$2.php?shopURL=$1 [L,QSA]
答案 1 :(得分:0)
试试这个:
上的RewriteEngine
RewriteBase /
RewriteRule ^ 1/2 /(.*)http://www.example.com/negocio/2.php?shopURL=1 [L,QSA]
答案 2 :(得分:0)
在.htaccess中试试
RewriteEngine on RewriteBase / RewriteCond $1 !^(negocio) RewriteRule ^(.*)$ negocio/$1.php [L,QSA]