Title: Relative Path Issues
Last modified: August 18, 2016

---

# Relative Path Issues

 *  [kraftomatic](https://wordpress.org/support/users/kraftomatic/)
 * (@kraftomatic)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/relative-path-issues/)
 * Hey Guys,
 * I’ve got the following two pages. One when I click on a category listing (say
   General posts), which looks like this:
 * [http://localhost/wordpress/category/general/](http://localhost/wordpress/category/general/)
 * And the second when I view a post in detail:
 * [http://localhost/wordpress/30](http://localhost/wordpress/30)
 * The second link works great with my surrounding CSS/images/layout/etc., but the
   first doesn’t because of the path. Everything breaks.
 * Is there any way to correct this? With the default scheme, the first link looks
   like this in WordPress, which works:
 * [http://localhost/wordpress/?cat=1](http://localhost/wordpress/?cat=1)
 * Any suggestions would be greatly appreciated.
 * Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/relative-path-issues/#post-458337)
 * What are you using to pass css styling to your pages? In other words, what does
   the <style> line(s) in your template look like?
 *  Thread Starter [kraftomatic](https://wordpress.org/support/users/kraftomatic/)
 * (@kraftomatic)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/relative-path-issues/#post-458338)
 * For the base stuff, it looks like this:
 * <link rel=”stylesheet” href=”<?php bloginfo(‘stylesheet_url’); ?>” type=”text/
   css” media=”screen” />
 * But I have added other stylesheets and images that aren’t referenced that way
   via PHP .. and I’m not sure how to handle them.
 * Thanks.
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/relative-path-issues/#post-458339)
 * Then the question is, are you using relative (dir/style.css) or absolute ([http://localhost/dir/style.css](http://localhost/dir/style.css))
   urls to the other stylesheets and images?
 * Also, localhost as your address could be an issue if viewing the site on other
   computers. In that case you want to use the IP assigned by your network to the
   hosting PC.
 *  Thread Starter [kraftomatic](https://wordpress.org/support/users/kraftomatic/)
 * (@kraftomatic)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/relative-path-issues/#post-458342)
 * That’s the thing. I’m using relative links, and it’s working in some cases, but
   not others (see first post). I’d like to make the path to archived posts (the
   first link) the same as the second one, so I can keep relative linking everywhere
   on the site.
 * It shouldn’t be a big deal I’m thinking ..
 * Thanks.
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/relative-path-issues/#post-458345)
 * If you want to avoid the [http://localhost](http://localhost) portion for your
   urls then you can, but you at least need to ‘start at the top’ or root of your
   site, so that:
 * /wordpress/category/general/
 * links up to the General category archive. Note the slash at the beginning, which
   tells the browser to start at the root and work its way down. Same goes for say
   css file listing:
 * /wordpress/wp-content/themes/MY-THEME/alt-style.css
 * You want to make sure that, where ever the browser finds itself, it always starts
   looking from the root for a file. Not a problem with the _/?key=value_ default
   permalinking, since everything is automatically seen from the root dir, but with
   custom permalinks the browser doesn’t know to start there unless you explicitly
   tell it to.
 *  Thread Starter [kraftomatic](https://wordpress.org/support/users/kraftomatic/)
 * (@kraftomatic)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/relative-path-issues/#post-458474)
 * Right, but why is the single post page linking one way, and the archives page
   linking another (ie. each has a different path to the page itself)?
 * If they both were the same, then there wouldn’t be a problem. But I’ve got one
   working and one not working, which is the cause of my problem.
 * Does that make sense?
 *  Thread Starter [kraftomatic](https://wordpress.org/support/users/kraftomatic/)
 * (@kraftomatic)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/relative-path-issues/#post-458478)
 * Ok – I set my permalink structure back to the default setting, and everything
   works correctly.
 * This is nice, but of course I can’t use the preferred (and cleaner) permalink
   structure ..
 * Arg ..
 *  Thread Starter [kraftomatic](https://wordpress.org/support/users/kraftomatic/)
 * (@kraftomatic)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/relative-path-issues/#post-458492)
 * Doh – with the permalink change, now my secondary pages don’t work. Ahhhh. 🙂
 * Any suggestions?
 * Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Relative Path Issues’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 2 participants
 * Last reply from: [kraftomatic](https://wordpress.org/support/users/kraftomatic/)
 * Last activity: [19 years, 8 months ago](https://wordpress.org/support/topic/relative-path-issues/#post-458492)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
