htaccess的 - 如何重定向所有的URL url.php除了index.php文件有的、重定向、文件、htaccess

由网友(迷失深渊的猫)分享简介:RewriteEngine叙述在#打开重写引擎重写规则。 url.php [NC,L]我重定向所有url.php的请求,但我想离开的index.php原样。 解决方案 #打开重写引擎RewriteEngine叙述上#排除url.php和index.php文件从重定向的RewriteCond%{REQUES...

  RewriteEngine叙述在#打开重写引擎
重写规则。 url.php [NC,L]
 

我重定向所有url.php的请求,但我想离开的index.php原样。

解决方案

 #打开重写引擎
RewriteEngine叙述上

#排除url.php和index.php文件从重定向
的RewriteCond%{REQUEST_URI} ^ /!(指数| URL) PHP

#重定向到url.php
重写规则。 url.php [NC,L]
 

RewriteEngine On    # Turn on the rewriting engine
RewriteRule    .    url.php    [NC,L]    
PHP .htaccess 在自己电脑上运行正常上传到空间打不开

I'm redirecting all the requests to url.php but I want to leave index.php as is.

解决方案

# Turn On ReWrite Engine
RewriteEngine On

# Exclude url.php and index.php from redirecting
RewriteCond %{REQUEST_URI} !^/(index|url).php

# Redirect to url.php
RewriteRule . url.php [NC,L]

阅读全文

相关推荐

最新文章