php 表单 mvc url,如何在PHP中为MVC目的重写url

这在localhost上工作正常:

#The RewriteEngine directive enables or disables the runtime rewriting engine.

RewriteEngine On

#This won't allow any folder to be accessible if it's not having an index.php file

Options All -Indexes

#This will redirect user to http://localhost/awe/ if 404 or 403 error comes

ErrorDocument 404 http://192.168.1.6/app/

ErrorDocument 403 http://192.168.1.6/app/

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-l

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

同样在Godaddy.com服务器上给我错误: Error 500

当我删除 Options All -Indexes 它用于显示第一页作为index.php存在但不显示内部页面并显示 404 错误,因为它在我的 Bootstrap 下定义 . 请注意需要做什么 .

此外,我已将其放入我的一个子域和一个文件夹中:所以我的应用程序的路径是这样的:

http://mysubdomain.mywebsite.com/myprojectname/app

所以我的 .htaccess 文件只放在这个文件夹中 http://mysubdomain.mywebsite.com/myprojectname/app

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值