Absolute Path for Deployment in a Non-Root Location

后端 未结 8 1304
耶瑟儿~
耶瑟儿~ 2021-01-06 13:22

I typically refer to any assets on my site using absolute path so that I don\'t have to worry about the location of the assets relative to current file.

<         


        
8条回答
  •  孤街浪徒
    2021-01-06 13:45

    I don't think this is gonna happen for you man, sorry.

    You have absolute paths in your documents, and want apache to prepend /holiday to them all without effecting the actual docroot? You can have one or the other, but not both.

    You need to either do a mass edit and prepend the directory yourself, or move your images/css/etc into the actual root directory.

    mod_rewrite is powerful, but can't really determine intent and parse the same url two different ways depending on what the user wants.

    Edit:

    I am wrong, but I don't have your answer. You may be able to use IS_SUBREQ in mod_rewrite to only apply the re-write conditions for sub-requests from your /holiday/index.php

提交回复
热议问题