是否可以使用RewriteRules
来忽略目录中的所有实际文件?我的意思是,我正在创建page.php处理的“flatlinks”或“permalinks”(http://example.com/not/an/actual/file/path/)。这只适用于如果我忽略所有其他文件与RewriteCond
。而不是创建一个RewriteCond
为在我的.htaccess文件目录中的每个真实文件是否有办法告诉它检查是否有一个实际的文件显示,如果不让page.php照顾它?使用.htaccess“忽略”文件
RewriteCond %{REQUEST_URI} !^/index\.php$
RewriteCond %{REQUEST_URI} !^/somefile\.php$
RewriteCond %{REQUEST_URI} !^/someotherfile\.php$
RewriteCond %{REQUEST_URI} !^/page\.php$
RewriteRule ^([^/]*)$ /page.php?p=$1 [L] [NC]
作品一种享受!你是第一个,所以你可以得到答案。 – bwoogie