Ubuntu上开启Apache Rewrite功能的方法
Ubuntu上开启Apache Rewrite功能的方法
# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf # Include all the user configurations:
Include /etc/apache2/httpd.conf # Include ports listing
Include /etc/apache2/ports.conf
......
# Include generic snippets of statements
Include /etc/apache2/conf.d/ # Include the virtual host configurations:
Include /etc/apache2/sites-enabled/
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^abc.com [NC]
RewriteRule ^(.*)$ http://www.shouce.ren/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www.abc.com[NC]
RewriteRule ^(.*)$ http://www.shouce.ren/$1 [L,R=301]
<VirtualHost 12.34.56.78:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn CustomLog /var/log/apache2/access.log combined Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory> </VirtualHost>
Ubuntu上开启Apache Rewrite功能的方法的更多相关文章
- 如何开启Apache Rewrite功能
一.Ubuntu默认未开启Rewrite支持 apche模块加载工作已分散到不同的配置文件,这样看起来似乎更为合理,管理起来也非常方便.下面看一下如何开启Rewrite模块,当用户需使用301重定向. ...
- 在Ubuntu中开启Soft AP功能
在Ubuntu中开启Soft AP功能 1.查看采用的无线网卡是否支持Soft AP: 注意,可以看到有AP字样,表明支持.楼主比较背,在易迅上挑了个销量最高的netcore nw360,结果无法搭建 ...
- APACHE 服务器开启URL REWRITE模块的方法
最近做wordpress,发现固定链接总是设置不了.后来发现是由于apache服务器的URL REWIRITE模块没有开启导致. 查询了资料之后终于设置成功,记录下步骤: 1:开启apache的url ...
- Ubuntu中开启MySQL远程访问功能,并将另一个数据库服务器中的数据迁移到新的服务器中
一.开启MyS远程访问功能 1.进入服务器输入netstat -an | grep 3306确认3306是否对外开放,MySQL默认状态下是不对外开放访问功能的.输入以上命令之后如果端口没有被开放就会 ...
- Windows7上开启ftp服务器功能
开启ftp服务功能 1 进入“控制面板”->“程序”->"打开或关闭Windows功能",找到“Internet信息服务”选项 2 将“Internet信息服务”选 ...
- activate mod_rewrite How To Set Up mod_rewrite for Apache on Ubuntu 14.04 Apache Rewrite url重定向功能的简单配置
https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite-for-apache-on-ubuntu-14-0 ...
- 手把手教你在Ubuntu上安装Apache、MySql和PHP
1:首先安装apache:打开终端(ctrl+Alt+t), 输入命令:sudo apt-get install apache2即可安装, 安装完后,打开浏览器,在地址栏输入:localhost或者h ...
- 手把手教你在ubuntu上安装apache和mysql和php
1:首先安装apache:打开终端(ctrl+Alt+t), 输入命令:sudo apt-get install apache2即可安装, 安装完后,打开浏览器,在地址栏输入:localhost或者h ...
- centos 开启apache rewrite模式
mod_rewrite能使网页伪静态,对于搜索引擎友好,下面就是开启这个功能的说明!启用mod_rewrite模块在conf目录的httpd.conf文件中找到 LoadModule rewrite_ ...
随机推荐
- layer 限定时间消失
默认tips层几秒后自动关闭.请问如何实现类似页面层时,点击页面层外部遮罩手动关闭的效果? 下面我加了time: 20000 时间控制在20秒后自动关闭,但是显得比较呆板,不如用户手动点击关闭来的灵活 ...
- String、StringBuffer、StringBuilder区分和性能比较
转载自:http://www.cnblogs.com/fancydeepin/archive/2013/04/23/min-snail-speak_String-StringBuffer-String ...
- 51Nod 1010 只包含因子2 3 5的数 | 预处理+二分
Input示例 5 1 8 13 35 77 Output示例 2 8 15 36 80 分析:将所有的只含有2 3 5因子的数打一个表保存在一个数组里,然后二分查找第一个>=数组里的数,输出 ...
- 2015/9/2 Python基础(7):元组
为什么要创造一个和列表差别不大的容器类型?元组和列表看起来不同的一点是元组用圆括号而列表用方括号.而最重要的是,元组是不可变类型.这就保证了元组的安全性.创造元组给它赋值和列表完全一样.除了一个元素的 ...
- 【51NOD】斜率最大
[题解]通过画图易得结论:最大斜率一定出现在相邻两点之间. #include<cstdio> #include<algorithm> #include<cstring&g ...
- Intersecting Lines (计算几何基础+判断两直线的位置关系)
题目链接:http://poj.org/problem?id=1269 题面: Description We all know that a pair of distinct points on a ...
- 阿里云服务器下安装配置 vsftpd —— 基于CentOS 6.3 【简洁版】
原文链接:http://www.tuicool.com/articles/nuiQBja 1.更新yum源 我是直接 yum update 更新的 2.安装vsftp 使用yum命令安装vsftpd ...
- ES6新增的let与const
1.const 声明常量,一旦声明必须立马赋值,否则报错 const PI = 3.14 const PI; //报错:Uncaught SyntaxError: Missing initialize ...
- vue-实现倒计时功能
JavaScript 创建一个 countdown 方法,用于计算并在控制台打印距目标时间的日.时.分.秒数,每隔一秒递归执行一次. msec 是当前时间距目标时间的毫秒数,由时间戳相减得到,我们将以 ...
- Professional Linux Kernel Architecture 笔记 —— 中断处理(Part 2)【转】
转自:http://blog.163.com/vic_kk/blog/static/494705242010719483774/ Table of Contents 1 中断 1.1 中断的类型 1. ...