mod_rewrite problem with relative path css/js

后端 未结 4 1013
独厮守ぢ
独厮守ぢ 2021-01-05 14:55

Hi I have a problem. I want to get all requests to redirect to index file in main directory and I\'ve achieved this but there are problems with relative paths.
When I pu

4条回答
  •  半阙折子戏
    2021-01-05 15:42

    This is a path resolution issue: When using the relative path ./css on the base path /something it is resolved to /css while on /something/somethingelse it is resolved to /something/css.

    This can’t (or rather shouldn’t) be fixed with mod_rewrite. Use absolute paths instead of relative paths, so /css instead of ./css.

提交回复
热议问题