Apache Typecho框架启用地址重写
地址重写有利于SEO优化,开启地址重写可以去掉Typecho框架中的index.php后缀,该后缀如下。

第一步,进到apache配置文件目录下cat /etc/httpd/conf/httpd.conf 加入以下模块。
LoadModule rewrite_module modules/mod_rewrite.so
第二步,配置空间权限,将AllowOverride None改为AllowOverride All
# Further relax access to the default document root:
<Directory "/var/www/html">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
第三步,在网站根目录新建vim /var/www/html/.htaccess写入重写规则。
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
第四步,启用地址重写。

再次访问即可完成。

Apache Typecho框架启用地址重写的更多相关文章
- Farseer.net轻量级开源框架 中级篇:UrlRewriter 地址重写
导航 目 录:Farseer.net轻量级开源框架 目录 上一篇:Farseer.net轻量级开源框架 中级篇: Cookies.Session.Request 下一篇:Farseer.net轻量 ...
- 解决URL中包含“%2F”导致Apache地址重写mod_rewrite失效的问题
在使用Apache地址重写mod_rewrite期间,发现,当URL和PATH_INFO中出现%2f(/)或者%5c(\), 会被认为这是个不合法的请求, Apache将会直接返回"404 ...
- 项目搭建系列之四:SpringMVC框架下使用UrlRewrite实现地址重写
简单记录一下UrlRewrite实现地址重写功能. 1.pom.xml 在pom.xml增加配置UrlRewrite jar <!-- URL Rewrite --> <depend ...
- php url地址重写
地址重写: urlRewrite: 就是: 1. 将php的地址index.php不写只写Action模块和function方法, 或者 2. php地址转变成html地址, 就是一种假的html, ...
- Nginx_地址重写(rewrite)_日志管理(log_format)_压缩输出_Nginx设定限速_Nginx设置反向代理及反向代理缓存
Nginx地址重写 Nginx rewrite rewrite语法规则1).变量名可以使用 "=" 或 "!=" 运算符~ 区分大小写~* 不区分大小写^~ 禁 ...
- Apache 流框架 Flink,Spark Streaming,Storm对比分析(一)
本文由 网易云发布. 1.Flink架构及特性分析 Flink是个相当早的项目,开始于2008年,但只在最近才得到注意.Flink是原生的流处理系统,提供high level的API.Flink也提 ...
- Web Service与Apache CXF 框架
一.WebService简介 为了支持跨网络的机器间相互操作交互而设计,用于开发分布式的互操作的应用程序组件. Web Service服务通常被定义为一组模块化的API,它们可以通过网络进行调用,来执 ...
- 高级运维(三):部署Lnmp环境、构建Lnmp平台、地址重写
一.部署LNMP环境 目标: 安装部署Nginx.MariaDB.PHP环境 1> 安装部署Nginx.MariaDB.PHP.PHP-FPM: 2> 启动Nginx.MariaDB.FP ...
- Apache—DBUtils框架简介
转载自:http://blog.csdn.net/fengdongkun/article/details/8236216 Apache—DBUtils框架简介.DbUtils类.QueryRunner ...
- JDBC 学习笔记(四)—— 自定义JDBC框架+Apache—DBUtils框架+事务管理+操作多表
本文目录: 1.自定义JDBC框架 ——数据库元数据:DataBaseMetaData 2.自定义JDBC框架 ——数据库元数据:DataBaseMetaData ...
随机推荐
- KYOCERA Programming Contest 2021(AtCoder Beginner Contest 200)(AB水题,C思维,D搜索,E DP)
补题链接:Here A - Century 整除 \(200\) 并且判断能否整除完全 B - 200th ABC-200 按题意即可 C - Ringo's Favorite Numbers 2 求 ...
- vue-cli3.x中public和assets的区别
今天开发了一个html5视频播放功能. vedio.mp4资源放在public文件夹下.那vue-cli3.x中public和assets的区别 vue-cli3.0有两个放置静态资源的目录分别是pu ...
- mixin混合
多个组件有相同的逻辑,抽离出来 mixin并不是完美的解决方案,会有一些问题 vue3提出composition api旨在解决这些问题
- B3637-DP【橙】
这题我用sort的时候大意了,从1开始使用的下标但是用sort时没加1导致排序错误,排了半天错才发现. 另外,这道题我似乎用了一种与网络上搜到了做法截然不同的自己的瞎想出来的做法,我的这个做法需要n^ ...
- LightOJ 1094
题意:就是求一个树的直径,也就是求任意两点的最大距离. 做法:跑两遍DFS,详见代码. #include<iostream> #include<cstdio> #include ...
- python+appium使用方法
一.python环境安装 确保需安装Appium-Python-Client包
- zipkin 与 sleuth 实现链路追踪
本文为博主原创,转载请注明出处 1.Zipkin 与 Sleuth 简介 zipkin 的官网地址: https://zipkin.io/ Zipkin 和 Sleuth 都是由 Twitter 开源 ...
- kafka 集群环境搭建
本文为博主原创,未经允许不得转载: 如果搭建单机节点 kafka 可看我的这篇博客: 搭建 kafka 集群环境,只需要在搭建单机 kafka 环境的基础上,多增加几个kafka 服务实例即可. 多增 ...
- centos7使用nginx+uwsgi部署python django项目
在django框架中,我们一般直接通过python manage.py runserver来启动提供服务,但是如果生产环境此方法不可行,而且容易导致异常退出,于是需要借助uwsgi来作为守护进程. 操 ...
- java - Array 数组反序输出
通过Array类的静态 sort() 方法可实现对数组排序,sort() 方法提供了许多种重载形式,可对任意类型数组进行升序排序. 然而,Array类中没有类似 js 的 reverse 反序输出 ...