Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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 - Fatal编程技术网

写入.htaccess文件以检查来自根目录的请求

写入.htaccess文件以检查来自根目录的请求,.htaccess,.htaccess,我在编写.htaccess来帮助我处理来自根目录的请求时遇到问题,即可以处理来自子文件夹的用户对的请求 所以,我想澄清一下,每次用户访问http://domain.com/abc/,我的代码在http://domain.com/index.php 将像处理GET请求一样处理GET请求http://domain.com/index.php?url=abc. 我没有太多与.htaccess合作的经验,希望有人能帮助我: 谢谢。在.htaccess文件中尝试此代码: Options +FollowSy

我在编写.htaccess来帮助我处理来自根目录的请求时遇到问题,即可以处理来自子文件夹的用户对的请求

所以,我想澄清一下,每次用户访问http://domain.com/abc/,我的代码在http://domain.com/index.php 将像处理GET请求一样处理GET请求http://domain.com/index.php?url=abc.

我没有太多与.htaccess合作的经验,希望有人能帮助我:


谢谢。

在.htaccess文件中尝试此代码:

Options +FollowSymlinks -MultiViews
RewriteEngine on

RewriteRule ^(abc)/?$ index.php?url=$1 [L,NC,QSA]

请记住,上述规则仅适用于URI/abc或/abc/

我在使用您的代码时遇到了500个内部服务器错误,但它仍然适用于我以前的代码。我已经在Apache中打开了mod_rewrite:还有其他配置没有告诉你吗?糟糕的是,我有一个输入错误,很抱歉。请再试一次。