Support » Fixing WordPress » Permalink problem – not the usual sort

  • Hoping someone can help me – I’m having trouble with the permalinks but not the same trouble as other posters (as far as I can tell)

    My permalinks work, but because I have an unusual structure to my site, the permalinked pages are missing the necessary css stylesheet, obviously because the stylesheet is located in my site’s root folder, and the permalinks refer to a subdirectory that is domain/2006/11/21/post_title that is at least virtually several levels below where the stylesheet is located.

    I could use a absolute reference to my stylesheet – e.g. but I would prefer to do that only if necessary –

    I am not using any WP themes but had to create my own layout to match what the customer is using for their site redesign (not yet live) and it was critical to keep their existing directory and filename structure as they had pages that ranked well for some of their keywords – so to make a long story short I just inserted the appropriate PHP code for the Posts into the part of their home page where they wanted the “blog” to appear – they also insisted that it remain named index.html, not index.php so I added a line to the .htaccess file to allow php to run from within an html page.

    I used the direct (relative) reference to their stylesheet because I could not figure out where WP wanted it to be in order to use the <?php bloginfo(‘template_url’); ?>

    If someone can tell me how to put in a <?php command to find the stylesheet wherever it lives, or where I can put a copy of the stylesheet so that the permalinks can find it, this should solve my problem.


Viewing 5 replies - 1 through 5 (of 5 total)
  • Probably there are multiple solutions… but in similar cases I just created a theme that looks exactly as the whole (original) site, using their own stylesheet + adding several WP specific things, and uploaded the theme in the usual wp-content/themes/theirtheme/ location.

    Hi Moshu
    Thanks for the comments, but unfortunately I am not able to use the directory structure of wp-content/themes/themename because when I tried that none of the links to any of the other (pre-existing) pages worked, and those pages couldn’t find the stylesheet either – the old pages need to stay where they are to avoid returning 404s as they are indexed already and doing well in SERPs – we want to avoid having to do 301 redirects at all costs so the preferred method is to have all files in the root folder. It works fine this way – all pages can be reached including the permalinks to posts, but the permalinked pages just can’t seem to find the stylesheet…..

    This is an odd problem I know – I could just try copying the stylesheet into the various WP subdirectories, but then I’d have to update all those copies every time a change is made to the stylesheet – and of course I’m just assuming that would work….

    I am not sure I understand it.
    Leave the existing pages/files + their stylesheet where they are.
    And let WP use its own (in a theme).
    Why that doesn’t work?

    The blog is not separate – it is now the “home” page – if I use the WP Themes function, it wants the home page in a php format (index.php) which is actually a construct of various files (header.php, index.php, footer.php, etc) and it lives in the wp-content/themes/themename folder – not the root folder of the domain. That is not an option. The home page must remain named index.html and live in the root folder.

    I can get everything working by telling WP to *not* use themes, but then I have to use a direct reference to my stylesheet instead of allowing WP to find it in the themes folder. All works fine, but the permalinked pages, because they are virtual and referenced as several directories under the root, in folders that don’t actually exist except in the database, cannot find the stylesheet, and so while all the content is there when you click on the permalinks, none of the layout or backgrounds or other styles are.

    So my thought was that if someone knows where WP wants a non-themed stylesheet to be I could copy it to that location and reference it there, or if there is a <?php command (I am not a php coder) to tell WP where to find the stylesheet no matter what is being referenced, then that might fix my problem.

    I know this is a very weird one – I will probably find a fix after many hours of struggle – I was just hoping someone could help me avoid spending days on this one….

    Update: I figured out that WP is wanting the stylesheet and images to be in the directory wp-content/themes/default whenever a permalink/category link/archive link is clicked on – I can copy the stylesheet and images to there, but that means updating those in both the root and that directory every time there is a change made to the stylesheet or images.

    A friend recommend putting a symbolic link in that subdirectory back to the style.css and images folder located in the root, which I did using SSH, but that doesn’t seem to work – I still get the content but no layout styles or images.

    Does anyone have another suggestion?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Permalink problem – not the usual sort’ is closed to new replies.