WordPress.org

Ready to get started?Download WordPress

Forums

rewrite rule for static pages (3 posts)

  1. adb
    Member
    Posted 9 years ago #

    In my .htaccess file I'm using this:
    # START EZSTATIC RULE
    RewriteRule ^information/([^/]+)/?$ /index.php?static=$1 [QSA]
    # END EZSTATIC RULE
    The uri's deplay how I want, but now the background images, etc don't display as they are on my blog.
    Please help.

  2. Kafkaesqui

    Posted 9 years ago #

    To make sure you always have the proper path to images (etc.), start at the root and work your way down. For example, say I have a background image in a directory called images, a subdirectory of my weblog's root. I might point to it this way in my css:
    body {
    background-image: url(images/bg.jpg);
    }

    This works as long as a page resides in the directory where "images" is a subdirectory. Using mod_rewrite places pages (virtually) in other subdirectories, so the path to the images directory becomes invalid. To deal with this, I provide an absolute path to my background image, like so:
    body {
    background-image: url(/images/bg.jpg);
    }

    The slash (/) before images starts the directory path at the root, and now will always be located by a page.

  3. Another alternative to EzStatic is Faked Folders (if you haven't tried it already).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.