Pathing from ../ in subdomain

南楼画角 提交于 2019-12-02 18:56:23

问题


Lets say I create a subdomain : http://subdomain.mydomain.com/

That was originally at this url : http://mydomain.com/subfolder/folder/

How would I fix pathing issues for ../ on http://subdomain.mydomain.com/

without a replacing code in .htaccess? is it possible?


回答1:


let say I have some masive structure like this.

Now in this case I want to do is in the css -> style -> loginCSS I have a css file named as login and I want to take that

ca_grain_texture.jpg and set it as a background of my login.html file so we see that our html files are in the main directory and also our css folder is in main directory

so if i want to grab the grain jpg file from my login.css file. I have to do somthing like this.

e.g

body{
    background-image: url(../../../images/cs_grain_texture.jpg);
}

on writing ../ everytime it will jump one folder back similar to cd/ in command shell.

../ means it will go to loginCSS folder.

../../ means style folder.

../../../ means css which is the main directory.

I hope it helps understanding I understood this way and hope it clears your view.



来源:https://stackoverflow.com/questions/20233529/pathing-from-in-subdomain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!