.htaccess redirect if file doesn't exist

前端 未结 2 1634
粉色の甜心
粉色の甜心 2020-12-11 18:06

So here\'s what I\'m trying to do. I have a simple framework and I am using mod rewrite to rewrite the urls so that they point to the correct files. I have a process folder

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-11 18:57

    This rule alone should do it:

    RewriteCond %{DOCUMENT_ROOT}web/$0 !-f
    RewriteRule ^process/[^/]+$ web/process/default.php [L]
    

    If the requested path cannot be mapped to an existing file, it should be rewritten to the default file.

提交回复
热议问题