浏览器The requested URL * was not found on this server. 的解决方法

①apache的重写未开启,开启重写后,问题解决,方法如下:

apache 打开 httpd.conf 文件 找到

#LoadModule rewrite_module modules/mod_rewrite.so

去掉前面的#号

②找到

<Directory “E:/online/webs/Apache24/htdocs”>

Options Indexes FollowSymLinks

AllowOverride None =>改为 AllowOverride All

Order allow,deny

Allow from all

③在项目根目录创建.htaccess文件,文件内容如下

<IfModule mod_rewrite.c>
  Options +FollowSymlinks -Multiviews
  RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>

猜你喜欢

转载自blog.csdn.net/weixin_46504385/article/details/129472920
今日推荐