Why is Apache's RewriteRule revealing local paths?

前端 未结 3 1776
猫巷女王i
猫巷女王i 2021-01-04 02:36

I\'m trying to use RewriteRules in .htaccess with relative paths, but Apache seems to want to output the physical path instead of the s

3条回答
  •  青春惊慌失措
    2021-01-04 03:32

    For those who happen to arrive here from Google (like me), the short checklist:

    • Make sure you have RewriteBase / (or any other value - the statement is what is important)

    • If you use redirect ([R], [R=30x], etc) - make sure the new URI starts with a / and contains a path relative to your domain root

    • (If above didn't help yet) Restart Apache, clear your browser's cache (especially if you have used [R=301] at some point)

    That's what saved my day, maybe it will save yours too.

提交回复
热议问题