关于apache服务器rewrite 服务器apacheurl重写 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1.httpd.conf中rewrite模块是否正确开启2.你写入的这个配置文件是否有效 我在ubuntu下,没有发现httpd.conf文件,主配置文件只有apach2.conf,另外现在的配置是这样的.1.在/var/www/project/ShortURL目录下建立一个.htaccss文件内容如下: # Turn on rewrite engineOptions +FollowSymlinksRewriteEngine on# More rules belowRewriteRule ^index.php/(.*)$ index.php?controller=jump&method=jump&code=$1 [QSA2.在apach2.conf中做了如下配置: <Directory /var/www/project/ShortURL> Options FollowSymLinks AllowOverride ALL Require all granted</Directory>别的没有做配置.现在的问题是这样的:现在问题是每次输入http://localhost/project/ShortURL/index.php/149Ui3都会显示没有css样式控制的http://localhost/project/ShortURL/index.php内容(地址栏还是http://localhost/project/ShortURL/index.php/149Ui3),不能跳转到http://localhost/project/ShortURL/index.php?controller=jump&method=jemp&code=149Ui3这个地址 问题解决了,总结一下:问题描述:我的目的是在地址栏输入的url:http://localhost/project/ShortURL/index.php/149Ui3自动重写为http://localhost/project/ShortURL/index.php?controller=jump&method=jump&code=149Ui3<b>解决方案</b>1.在apach2.conf中做如下配置: <Directory /var/www/project/ShortURL> Options FollowSymLinks AllowOverride ALL Require all granted</Directory>2.在/var/www/project/ShortURL目录下建立一个.htaccss文件内容如下: # Turn on rewrite engine RewriteEngine on# More rules belowRewriteBase /RewriteRule ^index.php/(.*)$ http://localhost/project/ShortURL/index.php?controller=jump&method=j ump&code=$1 [L,R=301]<b>写在最后</b>没事的时候还得多看文档啊,感谢开源中国疯狂的蜗牛提供的思路. 如何实现 php登录人人网 不用他的api php获取当前URL地址和参数 页面的总页数大于1,当我选中第2页的一个checkbox,点击提交按钮时,怎么样能使页面不刷新到第1页?急 一人很奇怪的问题 php中的include 如果一个用户已经登陆,就不能在用这个用户进行登陆... PHP-SQL 亂碼問題 怎么取得复选下拉框的内容? 初学者:为什么我用var 定义变量报错呢 我做了一个简单的意见信箱,收到的信却是乱码,请问如何解决? 求大神给看看 用php写的代码 收到的短信是乱码 php如何安装 工行最新接口 求高手指点
2.你写入的这个配置文件是否有效
1.在/var/www/project/ShortURL目录下建立一个.htaccss文件内容如下: # Turn on rewrite engine
Options +FollowSymlinks
RewriteEngine on
# More rules below
RewriteRule ^index.php/(.*)$ index.php?controller=jump&method=jump&code=$1 [QSA2.在apach2.conf中做了如下配置: <Directory /var/www/project/ShortURL>
Options FollowSymLinks
AllowOverride ALL
Require all granted
</Directory>别的没有做配置.现在的问题是这样的:
现在问题是每次输入http://localhost/project/ShortURL/index.php/149Ui3都会显示没有css样式控制的http://localhost/project/ShortURL/index.php内容(地址栏还是http://localhost/project/ShortURL/index.php/149Ui3),不能跳转到http://localhost/project/ShortURL/index.php?controller=jump&method=jemp&code=149Ui3这个地址
问题描述:
我的目的是在地址栏输入的url:
http://localhost/project/ShortURL/index.php/149Ui3
自动重写为
http://localhost/project/ShortURL/index.php?controller=jump&method=jump&code=149Ui3
<b>解决方案</b>
1.在apach2.conf中做如下配置:
<Directory /var/www/project/ShortURL>
Options FollowSymLinks
AllowOverride ALL
Require all granted
</Directory>
2.在/var/www/project/ShortURL目录下建立一个.htaccss文件内容如下:
# Turn on rewrite engine
RewriteEngine on
# More rules below
RewriteBase /
RewriteRule ^index.php/(.*)$ http://localhost/project/ShortURL/index.php?controller=jump&method=j ump&code=$1 [L,R=301]
<b>写在最后</b>
没事的时候还得多看文档啊,感谢开源中国疯狂的蜗牛提供的思路.