新部署到服务器 报 The requested URL /home/profession was not found on this server. 错误

 

The requested URL /home/profession was not found on this server.

 

通过xxx.com, 首页可以正常访问,xxx.com/xx/xx 就出现 The requested URL xxx was not found on this server.

 

1,找到apache配置文件httpd.conf配置文件中的

AllowOverride none        
Require all denied

改成

Options Indexes FollowSymLinks    
AllowOverride All

 

2,找到apache配置文件httpd.conf配置并开启重写模块

LoadModule rewrite_module modules/mod_rewrite.so 

Ubuntu16.04模块在  /etc/apache2/mods-available 下,需要链接到  mods-enable 下

ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load

 

 

 3.加在重写,站点缺少 .htaccess 文件(文件在public下,没有就新建)

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

 

 

 

 

 

转载于:https://www.cnblogs.com/cap-rq/p/10891894.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值