. haccess导致了一个问题.每个页面名称都显示为查询


.htacess is causing an issue. Every page name is displayed as a query

好的,我有一个小的webstore区域,我设置了它,这样每个webstore都用'/webstore/?webstore=webstorename'我设法有它,所以你可以只输入'www.domain.com/webstorename'。但出于某种原因,每页都有"?"Webstore =pagename'尾随其后。例如:'www.domain.com/dash/?webstore=dash'

ErrorDocument 403 /errordocs/noaccess.php
ErrorDocument 404 /errordocs/notfound.php
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^([A-Za-z0-9]+)$ /webstore/index.php?webstore=$1

我不确定为什么会导致这种情况发生,但我希望这是一个小的修复。我很乐意回答你的任何问题。谢谢。

这个问题在这里被问到:.htaccess重写查询字符串作为路径

你应该把你的"webstore"放在一个路径中,然后测试它:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/?store/(.*?)$ /index.php?webstore=$1 [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}' /index'.php'?webstore=([^'&' ]+)
RewriteRule ^/?index'.php$ /store/%1 [L,R=301]