Pathing from ../ in subdomain

2019-03-06 05:22发布

问题:

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.