Home > Backend Development > PHP Tutorial > Apache url 重写

Apache url 重写

WBOY
Release: 2016-06-20 09:37:03
Original
1054 people have browsed it

RewriteEngine on
# 如果请求的是真实存在的文件或目录,直接访问
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# 如果请求的不是真实文件或目录,分发请求至 index.php
RewriteRule . index.php


回复讨论(解决方案)

如果你是分享,那么请不要拿错误(不完备)的东西来害人
如果你是提问,那么请说明你的问题

设置404状态码,404分发到index.php

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