apache rewrite 如果文件不存在就调转一个地址解决思路

WBOY
Release: 2016-06-13 13:49:53
Original
1143 people have browsed it

apache rewrite 如果文件不存在就调转一个地址
rewrite   可不可以做条件判断呀。
我想这样,如果一个静态文件(html)存在,就跳转的这个地址,
如果不存在就跳转到指定的php   文件,但这个文件应该不是404指定的文件

------解决方案--------------------
html和php同名吗? 还是一个php对应多个html?
------解决方案--------------------
可以这样: RedirectMatch 404 some.*\.html$ http://www.anotherserver.com/what.php
你学习一下应该就能满足你的具体业务.
http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirectmatch

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