Apache Typecho框架启用地址重写

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

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

image.png

第一步,进到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]

第四步,启用地址重写。

image.png

再次访问即可完成。

image.png

目录
相关文章
|
1月前
|
消息中间件 Kafka Apache
Apache Flink 是一个开源的分布式流处理框架
Apache Flink 是一个开源的分布式流处理框架
742 5
|
3天前
|
应用服务中间件 Apache nginx
apache、nginx开启rewrite重写服务及伪静态
apache、nginx开启rewrite重写服务及伪静态
18 4
|
1月前
|
分布式计算 Java Go
Golang深入浅出之-Go语言中的分布式计算框架Apache Beam
【5月更文挑战第6天】Apache Beam是一个统一的编程模型,适用于批处理和流处理,主要支持Java和Python,但也提供实验性的Go SDK。Go SDK的基本概念包括`PTransform`、`PCollection`和`Pipeline`。在使用中,需注意类型转换、窗口和触发器配置、资源管理和错误处理。尽管Go SDK文档有限,生态系统尚不成熟,且性能可能不高,但它仍为分布式计算提供了可移植的解决方案。通过理解和掌握Beam模型,开发者能编写高效的数据处理程序。
160 1
|
7月前
|
网络协议 Java API
Apache Mina高性能通信框架研究邮件列表.
Apache Mina高性能通信框架研究邮件列表.
47 0
|
7月前
|
分布式计算 Apache 流计算
官宣!流计算开发管理框架 StreamPark 成功进入 Apache 孵化器
官宣!流计算开发管理框架 StreamPark 成功进入 Apache 孵化器
128 0
|
XML Kubernetes 数据可视化
【集成架构】探索3种顶级「集成框架」Apache、Spring和Mule
【集成架构】探索3种顶级「集成框架」Apache、Spring和Mule
|
XML Kubernetes 数据可视化
「集成框架」探索3种顶级集成框架Apache Camel、Spring和Mule
「集成框架」探索3种顶级集成框架Apache Camel、Spring和Mule
|
消息中间件 Kubernetes Java
「集成架构」我们得谈谈 Apache Camel集成框架
「集成架构」我们得谈谈 Apache Camel集成框架
|
XML Kubernetes 数据可视化
探索3种顶级「集成框架」Apache、Spring和Mule
探索3种顶级「集成框架」Apache、Spring和Mule
|
分布式计算 算法 大数据
T-thinker | 继MapReduce, Apache Spark之后的下一代大数据并行编程框架
T-thinker | 继MapReduce, Apache Spark之后的下一代大数据并行编程框架
113 0

推荐镜像

更多