Home > Backend Development > PHP Tutorial > Introduction to PHP development-detailed explanation of turning on pseudo-static in Apache

Introduction to PHP development-detailed explanation of turning on pseudo-static in Apache

黄舟
Release: 2023-03-06 20:54:01
Original
1646 people have browsed it

环境:
系统 Windows
Apache 2.2

加载Rewrite模块:

在conf目录下httpd.conf中找到

LoadModule rewrite_module modules/mod_rewrite.so
Copy after login

这句,去掉前边的注释符号“#”,或添加这句。

允许在任何目录中使用“.htaccess”文件,将“AllowOverride”改成“All”(默认为“None”):

#
 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
Copy after login

在conf\httpd.conf 最后一行添加

RewriteEngine OnRewriteRule ^(.*)-htm-(.*)$ $1.php?$2
Copy after login

The above is the detailed content of Introduction to PHP development-detailed explanation of turning on pseudo-static in Apache. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template