views:

49

answers:

2

Hi, I'm trying to make a page for use with wordpress and it's almost working, The page I want to use is an HTML page with designated space for it within certain DIVs.

I'm encountering the problem of wordpress using the wrong links to kind of everything. I will probably have to change every link to http://www.mydomain.com/sub/folder/image.jpg while there are many links. the page is positioned in a subfolder, there where wordpress is installed on the server.

But other pages are positioned in the root, and retrieve all other files directly starting from the domain so writing /sub/folder/image.jpg is enough. Is there a way I could get this to work with html/php files in sub folders as well (so when typing a link like /sub/folder/image.jpg they retrieve http://www.mydomain.com/sub/folder/image.jpg and not http://www.mydomain.com/sub/folder/sub/folder/image.jpg

thanks!

+2  A: 

Every link starting with a slash / is absolute, meaning starting from the domain name.

If you omit the slash, then the path is relative and is appended to the current location.

Felix Kling
+2  A: 

If you are using URLs such as sub/folder/image.jpg with no slash at the beginning (i.e. relative URLs), the browser should add this to the current folder.

Which means that if the current document is :

http://www.mydomain.com/sub/folder/my-page.html

You should end up with this :

http://www.mydomain.com/sub/folder/sub/folder/image.jpg


But if you use URLs such as /sub/folder/image.jpg with a slash at the beginning (i.e. absolute URLs), the browser should start from the domain-name.

Which means that, with the same URL for your HTML document, you'd end up with this :

http://www.mydomain.com/sub/folder/image.jpg
Pascal MARTIN
thanks,please note that the problem is with wordpress.wordpress is installed in a subfolder www.mydomain.com/common/so every link with a slash is starting from that subfolder which is acting like the domain/root which I find weird but to a certain extent it's logical.The page I generate with wordpress works well, only for some images that fail to load because the page sees http://www.mydomain.com/common as its root.
Andy