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
PHP MVC框架htaccess重写规则在链接上自动添加单词“?url=xxx”_Php_.htaccess_Mod Rewrite - Fatal编程技术网

PHP MVC框架htaccess重写规则在链接上自动添加单词“?url=xxx”

PHP MVC框架htaccess重写规则在链接上自动添加单词“?url=xxx”,php,.htaccess,mod-rewrite,Php,.htaccess,Mod Rewrite,我是PHP MVC框架的初学者,我已经学习了PHP MVC框架,并且已经完成了90%。所有的工作几乎都正常。但是我有个问题。。。我解决不了 在我访问我的口述中已经存在的“目录名称”后,链接将自动更改为localhost/mvc/“目录名称”/url='name\u of_directory'?,自动添加“目录名称”'url?='name\u of_directory' 例如: localhost/mvc/'exist_dirctory' => localhost/mvc/'exist_dirct

我是PHP MVC框架的初学者,我已经学习了PHP MVC框架,并且已经完成了90%。所有的工作几乎都正常。但是我有个问题。。。我解决不了

在我访问我的口述中已经存在的“目录名称”后,链接将自动更改为localhost/mvc/“目录名称”/url='name\u of_directory'?,自动添加“目录名称”'url?='name\u of_directory'

例如:

localhost/mvc/'exist_dirctory' => localhost/mvc/'exist_dirctory'?url=exist_dirctory' localhost/mvc/test => localhost/mvc/test?url=test localhost/mvc/db => localhost/mvc/db?url=db localhost/mvc/public => localhost/mvc/public?url=public ... if name not exist on my directory all is working properly localhost/mvc/index => localhost/mvc/index/ localhost/mvc/help => localhost/mvc/help/ ... but if i add a backslash behind it work properly localhost/mvc/test/ => localhost/mvc/test/ localhost/mvc/db/ => localhost/mvc/db/ localhost/mvc/public/ => localhost/mvc/public/ 我的项目目录 .htaccess 我不想它的保持自动添加在我的链接后面的东西。。。能告诉我怎么解决吗


对不起,我的英文是

目录的名称总是url值吗?如果是这样的话,您可以从URI中获取它,这样就不需要url$\u GET variableDavin Jones感谢重播!下面是一个示例问题:我有一个名为“test”的目录名,如果您尝试该链接,它将变为。 mvc +config +controllers +db +libs +models +public +test +views RewriteEngine On #RewriteCond %{REQUEST_FILENAME} !-d ## i want to rewrite also directory RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]