Home > Backend Development > PHP Tutorial > 请教一个apache Rewrite匹配规则

请教一个apache Rewrite匹配规则

WBOY
Release: 2016-06-23 14:25:01
Original
782 people have browsed it

我想把首页 xxx.abc.com 自动跳转到xxx.abc.com/home.php,请问该如何写匹配规则?
要做到 xxx.abc.com/*.php---即带有后缀的url都要保证不变
rewriteEngine on
RewriteCond **********
RewriteRule ****************** [L]

非常感谢! 


回复讨论(解决方案)

这个可以不用重写。
检查url,如果是xxx.abc.com ,直接用header函数跳转到xxx.abc.com/home.php。

或者使用 Apache的DirectoryIndex

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