www.webdeveloper.com
Results 1 to 12 of 12

Thread: Weird Links..

  1. #1
    Join Date
    Aug 2012
    Location
    Nottingham, UK
    Posts
    7

    Weird Links..

    Hi, I am remaking my personal portfolio site www.pjsmedia.co.uk and i have a weird problem.

    When i click on the 'about' tab the url comes up as http://pjsmedia.co.uk/about.php/port....php/about.php

    Why is this and how do i correct it. I have never had this problem before, and cant see any logical reason its doing this.

    Please Help!

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,333
    Since we have no idea what code you're running and/or web server URL-rewriting is in effect, it will be pretty difficult for us to debug that. In any case, I don't see the problem you're describing, so maybe you already fixed it?
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Aug 2012
    Location
    Nottingham, UK
    Posts
    7
    nothings fixed yet, just click through the tabs and watch the address bar.. Its just simple HTML, just used php includes for the header.. the header is exactly the same as the source code.
    Just tried it again and http://pjsmedia.co.uk/about.php/port...portfolio.php/
    I dont understand why its not just http://pjsmedia.co.uk/portfolio.php or http://pjsmedia.co.uk/contact.php

  4. #4
    Join Date
    Jun 2006
    Location
    Under your bed
    Posts
    357
    When I click About I get: http://www.pjsmedia.co.uk/about.php

    When I click Portfolio I get: http://www.pjsmedia.co.uk/portfolio.php

    When I click Contact I get: http://www.pjsmedia.co.uk/contact.php

    Don't know if it matters but I got the same results in both Google Chrome and IE 9.
    The better I get at programming, the more I appreciate arrays. Handy dandy things they are.

  5. #5
    Join Date
    Aug 2012
    Location
    Nottingham, UK
    Posts
    7
    How bizarre! im using google crome, Il try and video what im getting and post it on here..

  6. #6
    Join Date
    Aug 2012
    Location
    Nottingham, UK
    Posts
    7

  7. #7
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    795
    As your pages are all on the root of the website, why not prepend a slash and make them absolute paths in html:

    Code:
    <td><a href="/index.php" style="text-decoration: none">Home</a></td>
    <td><a href="/about.php" style="text-decoration: none"><span class="style2">About</span></a></td>
    <td><a href="/portfolio.php" style="text-decoration: none"><span class="style2">Portfolio</span></a></td>
    <td><a href="/contact.php" style="text-decoration: none"><span class="style2">Contact</span></a></td></span>
    JavaScript: Learn | Validate | Compact | bionoid

  8. #8
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,333
    I'd recommend that you start by fixing all the HTML validation errors, then see if you get uniform results among different browsers.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  9. #9
    Join Date
    Aug 2012
    Location
    Nottingham, UK
    Posts
    7
    Well using the <a href="/contact.php".. cetainly worked.. the only problem not is the about page having a / after the URL, So its not picking up the images.

  10. #10
    Join Date
    Aug 2012
    Location
    Nottingham, UK
    Posts
    7
    And just my magic, for no reason at all it decides to work!

    Thanks for that guys!

  11. #11
    Join Date
    Dec 2011
    Location
    Centurion, South Africa
    Posts
    795
    Quote Originally Posted by PJ's Media View Post
    Well using the <a href="/contact.php".. cetainly worked.. the only problem not is the about page having a / after the URL, So its not picking up the images.
    You can also use absolute paths for images/scripts/stylesheets as well. That should help if you ever serve pages off the root of the webserver.

    Quote Originally Posted by PJ's Media View Post
    And just my magic, for no reason at all it decides to work!

    Thanks for that guys!
    It is possible you were using cached content with the error. When in doubt clear your cache and check the source code.
    JavaScript: Learn | Validate | Compact | bionoid

  12. #12
    Join Date
    Jun 2006
    Location
    Under your bed
    Posts
    357
    What I was going to recommend trying is putting http://www.pjsmedia.co.uk/ in front of every URL in your code. If there are still problems then maybe look in your .htaccess file and see if there's anything in there? I don't know much about them but I know they can mess with your URLs.
    Last edited by evenstar7139; 08-18-2012 at 02:34 PM.
    The better I get at programming, the more I appreciate arrays. Handy dandy things they are.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles