地址重写有利于SEO优化,开启地址重写可以去掉Typecho框架中的index.PHP后缀,该后缀如下。 第一步,进到apache配置文件目录下cat /etc/Httpd/conf/httpd.c
地址重写有利于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: # # 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
第三步,在网站根目录新建vim /var/www/html/.htaccess
写入重写规则。
RewriteEngine OnRewriteBase /RewriteRule ^index\.php$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]
第四步,启用地址重写。
再次访问即可完成。
来源地址:https://blog.csdn.net/lyshark_csdn/article/details/128473228
--结束END--
本文标题: Apache Typecho框架启用地址重写
本文链接: https://lsjlt.com/news/389078.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0