显示文件夹中任何网址的自定义页面的内容

时间:2015-09-12 05:48:57

标签: .htaccess mod-rewrite

现在我想要以下功能。

domain.com/blablarandomnames/.... - must show domain.com/index.php

domain.com/claim/anyrandomnames/... - must show domain.com/claim/url.php

我尝试了下面的代码,但只有domain.com/blablarandomnames/正在运行,而不是另一个。

RewriteEngine On
RewriteBase /
RewriteRule ^claim(\/?)$ claim/url.php [QSA,NC,L]


RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule (.*)(\/?)$ / [QSA,NC,L]

1 个答案:

答案 0 :(得分:0)

尝试:

RewriteEngine On
RewriteBase /
RewriteRule ^claim.*$ claim/url.php [QSA,NC,L]


RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ / [NC,L]