WordPress.org

Support

Support » How-To and Troubleshooting » localhost WAMP install: trying to link to blog’s root (end up at localhost root)

localhost WAMP install: trying to link to blog’s root (end up at localhost root)

  • 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

Viewing 1 replies (of 1 total)
  • esmi

    @esmi

    Forum Moderator

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

Viewing 1 replies (of 1 total)
  • The topic ‘localhost WAMP install: trying to link to blog’s root (end up at localhost root)’ is closed to new replies.