Apache mod_rewrite - prefer files over directories with pretty URLs

前端 未结 2 2017
轻奢々
轻奢々 2021-01-07 10:45

I want to have pretty urls so http://www.domain.com/foo will return http://www.domain.com/foo.php

The issue is that there is a directory that has the same name. I ha

相关标签:
2条回答
  • 2021-01-07 11:18

    MultiViews could cause this behavior. Try to disable it.

    0 讨论(0)
  • 2021-01-07 11:34

    You need to use the whole path:

    RewriteCond "%{DOCUMENT_ROOT}%{REQUEST_FILENAME}.php" -f  
    

    REQUEST_FILENAME is just the full path inside DocumenRoot

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