WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. hobbsy
    Member
    Posted 4 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:

    Z:\wamp\www\wordpress-theme-browser
    http://localhost/wordpress-theme-browser

    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:
    http://locahost/wordpress-theme-browser/images/test.jpg

    but instead it looks for:
    http://www.localhost/images/test.jpg

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

    but this link points to:
    http://www.localhost/

    rather the desired URL of:
    http://locahost/wordpress-theme-browser/

    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]
    </IfModule>
    # END WordPress
    ---

  2. esmi
    Forum Moderator
    Posted 4 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