SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2000
    0 Post(s)
    0 Thread(s)

    Domain pointed at Directory...messed up links>??

    I know there has to be a simple was to fix this...but my brain isn't working very well right now.

    Here's what I did, what happened:
    Set up a directory in a site, and built a new site within that directory. Everything was working fine going to
    Was happy with it so I got a domain name and just pointed it to that directory on my hosted account. Did that yesterday, domain propogated today. Got home from work went to and all the images were missing. I had set them as "Root" relative. Then I realized all my links were "root" relative also! Went thru my site and changed all images and links to "document" relative. Problem solved....I thought.

    Checked my server logs and saw some traffic across the original pages for Traffic came from google, yahoo, and webcrawler. I'm put this stuff up over the weekend and it's being found!! Well, I go check the search engines, they of course had indexed Click the links...low and behold the images and links were messed up since I had just changed them to 'document' relative.

    So the linking will work as 'root' at, but needs to be 'relative' at pointing to that same directory. Only solution I see is to copy the /newsite/ directory to a different directory and point the new domain there, and fix the links for each individual issue.

    The concern here is over the fact that the pages were picked by the search engines so quick. I dont want missing links showing up when I know I'm getting traffic.

    Any quick solution that I'm not thinking of??


  2. #2
    Free your mind Toly's Avatar
    Join Date
    Sep 2001
    0 Post(s)
    0 Thread(s)
    Well, if you are using PHP and assuming your main page is index.php, you could check the url path and do a redirection if it is needed.

    PHP Code:
    if ($_SERVER['REQUEST_URI'] == "/newsite/index.php") {

    Even if you are not using PHP, I'm sure this would be easy to do with any other scripting language.
    Community Guidelines | Community FAQ

    "He that is kind is free, though he is a slave;
    he that is evil is a slave, though he be a king." - St. Augustine


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts