url absolute path/relative path

Discussion in 'Apache' started by netinio, Oct 3, 2011.

  1. #1
    Hi everybody,
    i have the following problem,
    I try to reach my site at site_name.com and the index.php try to open

    http:// site_name.com/home/account_name/public_html/skin/frontend/base/default/css/widgets.css

    instead of

    http:// site_name.com/skin/frontend/base/default/css/widgets.css

    it tries to the full path instead of the path after the public_html.
    I search for any informations on the internet but i didnt find anything, if somebody can help i will appreciate very much!!!!
     
    netinio, Oct 3, 2011 IP
  2. bvraghav

    bvraghav Member

    Messages:
    123
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #2
    Hi... what is the framework that powers your site?

    The most visible reason is that you link to
    /home/account_name/public_html/skin/frontend/base/default/css/widgets.css
    Code (markup):
    instead of
    /skin/frontend/base/default/css/widgets.css
    Code (markup):
    Besides, I was curious, how come this seems like an apache problem?
     
    bvraghav, Oct 6, 2011 IP
  3. netinio

    netinio Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    bvraghav thanks for your reply,
    the problem started when i setup an new vps and transfer my site, after this problem appeared i setup again the vps and the problem disappeared!!
    The site is an eshop and the addresses are relative and not absolute, its mean that the a links is created dynamically,
    so when the file of a link is at :

    /home/account_name/public_html/skin/frontend/base/default/css/widgets.css

    the server have to create the link

    http:// site_name.com/skin/frontend/base/default/css/widgets.css

    and not

    http:// site_name.com/home/account_name/public_html/skin/frontend/base/default/css/widgets.css

    anyway thanks
     
    netinio, Oct 7, 2011 IP
  4. helpinghost

    helpinghost Active Member

    Messages:
    36
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    53
    #4
    I think this has something to do with your .htaccess file. Did you maybe do a search and replace over the folder when you moved things and accidentally replaced a path you should not have?
     
    helpinghost, Oct 10, 2011 IP
  5. bvraghav

    bvraghav Member

    Messages:
    123
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    33
    #5
    hmmm... Sorry I am a bit too late to reply. If the problem still persists, there are a few speculations:
    The general algorithm to produce links dynamically, is
    1. use a BASE_URL, that is the root of your deployment say http:// sitename.com /path/to/deployment
    2. then publish the links relative to the deployment e.g.
      • http:// sitename.com /path/to/deployment /my-home-page.html
      • http:// sitename.com /path/to/deployment /category/sub-category/article.html
      • http:// sitename.com /path/to/deployment /login.php
      • http:// sitename.com /path/to/deployment /dashboard.php
      and so on and so forth. May be the /path/to/deployment is a variable defined in your config file, and not well defined.
    3. It might also be a case of database mismatch. While transferring a site, the database may contain the data recorded by the previous deployment, that are no more valid for the new deployment.

    But without looking at the software itself, there is no certain say.

    Also, I believe, you use the word 'server' as a collective term that can actually be broken further into pieces, the Apache Server, the software based on PHP [just a guess], and the MySQL Database. Setting up a VPS, and transferring a site might cause a slight mismatch in any of the parameters, leading you to believe that the things are broken; where, more often than not, it is only a matter of some flag/option being set right.
     
    bvraghav, Oct 29, 2011 IP