Apache下url重写,虚拟机设置
来源:互联网 发布:js电机 编辑:程序博客网 时间:2024/05/17 00:13
1.http://www.linuxsir.org/main/node/293
在httpd里打开mod_rewrite.so模块
2.在需要重写的网站目录下建立.htaccess文件
3.ErrorDocument 404 /notfound.html
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f //判断文件是否存在,不存在才执行重写
RewriteCond %{REQUEST_FILENAME} !-d //判断目录是否存在,不存在才执行重写
RewriteRule ^(.*)[.]html$ $1.php
</IfModule>
记得需要取用的字符串用()括起来,然后后面才能$1来取用
在httpd里打开mod_rewrite.so模块
2.在需要重写的网站目录下建立.htaccess文件
3.ErrorDocument 404 /notfound.html
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f //判断文件是否存在,不存在才执行重写
RewriteCond %{REQUEST_FILENAME} !-d //判断目录是否存在,不存在才执行重写
RewriteRule ^(.*)[.]html$ $1.php
</IfModule>
记得需要取用的字符串用()括起来,然后后面才能$1来取用
正则参考http://deerchao.net/tutorials/regex/regex.htm
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "D:/wamp/www/"
ServerName localhost
ServerAlias localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:/wamp/www/test/"
ServerName test
ServerAlias test
</VirtualHost>
- Apache下url重写,虚拟机设置
- Apache下的URL重写
- ubuntu下apache服务器开启url重写
- apache URL重写指南
- apache 2.2 url 重写
- Apache Drupal URL重写
- apache 重写php url
- Apache重写URL
- apache 实现url 重写
- apache配置URL重写
- apache的url重写
- Ubuntu Apache URL 重写
- php apache 重写URL
- Apache的URL重写
- Apache中设置虚拟主机的URL重写功能
- Apache中设置虚拟主机的URL重写功能
- Apache中设置虚拟主机的URL重写功能
- wamp win2003 drupal配置apache下url地址重写
- mysql中文字符编码问题
- i will keep a blog myself!
- 粒子滤波总结(摘来总结)
- 在终端for循环
- VC中的UpdateData()函数参数true/false的区别
- Apache下url重写,虚拟机设置
- 每天一道编程题(六)-------希尔排序
- 字符串太长 以及cocos2d-x在多线程中绘制图像变白色块问题
- hdu 1009 肥胖鼠 贪心(一) sort 排序函数
- 那些事儿
- css样式重写,英文超出
- 统计文件行数的shell
- Sql server存储过程以及一次插入多条记录
- extern用法详解