.htaccess redirect if file doesn't exist

前端 未结 2 1628
粉色の甜心
粉色の甜心 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:41

    You generally should have your RewriteCond calls before your RewriteRule. The Rule triggers if the Conds are met.

    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题