Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess HTACCESS重写多维(例如:www.mysite.com/variable2/variable2_.htaccess - Fatal编程技术网

.htaccess HTACCESS重写多维(例如:www.mysite.com/variable2/variable2

.htaccess HTACCESS重写多维(例如:www.mysite.com/variable2/variable2,.htaccess,.htaccess,嘿,我知道我可以用HTACCESS重写来写 www.mysite.com/index.php?page=hello&subpage=welcome 到 www.mysite.com/1/hello/welcome 但是有没有办法把它改写成 www.mysite.com/hello/welcome ??嗯,只要修改你的规则就行了。像这样的事情应该会起作用: RewriteRule ^(.*?)/(.*?)/$ index.php?page=$1&subpage=$2 [NC,L]

嘿,我知道我可以用HTACCESS重写来写

www.mysite.com/index.php?page=hello&subpage=welcome

www.mysite.com/1/hello/welcome

但是有没有办法把它改写成

www.mysite.com/hello/welcome


??

嗯,只要修改你的规则就行了。像这样的事情应该会起作用:

RewriteRule ^(.*?)/(.*?)/$  index.php?page=$1&subpage=$2 [NC,L]