localhost WAMP install: trying to link to blog's root (end up at localhost root) (2 posts)

  1. hobbsy
    Posted 6 years ago #

    This problem is probably really simple to solve with one extra line in my .htaccess (RewriteBase? BaseHREF??). I've spent about an hour Google searching for an answer and had no joy. Can anyone see where I'm going wrong please?

    I have set-up a localhost (WAMP) install of WordPress 2.9.2 at:


    I have enabled pretty permalinks and they are working fine

    In the future I hope to put this site live online

    rather than using absolute URLS
    [a href="http://www.example.com/images/test.jpg"]
    I was trying to use
    [a href="/images/test.jpg"]

    but this latter URL doesn't work as expected

    I imagined on my localhost it look for:

    but instead it looks for:

    Similarly, I just want to link to my homepage using
    [a href="/"]homepage[/a]

    but this link points to:

    rather the desired URL of:

    My .htaccess in localhost/wordpress-theme-browser is simply:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress-theme-browser/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress-theme-browser/index.php [L]
    # END WordPress

  2. esmi
    Forum Moderator
    Posted 6 years ago #

    Relative urls just don't work well in WordPress. Stick to absolute urls.

Topic Closed

This topic has been closed to new replies.

About this Topic