更新时间:2023-02-25 14:38:21
RewriteEngine叙述上
的RewriteCond%{} REQUEST_FILENAME!-f
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^ * $ /default.php [L]
I must do a little trick for a site! The idea is:
example:
www.mysite.com/page1.htm -> exists -> go to file page1.htm
www.mysite.com/page2.htm -> NOT exists -> go to file default.php but with url "www.mysite.com/page2.htm"
It's possible to do this all by .htaccess?
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /default.php [L]