SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot atetlaw's Avatar
    Join Date
    Feb 2007
    Location
    Melbourne, Australia
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Getting Wordpress to respect existing static content

    Fair warning, I'm a Wordpress noob.

    I've installed WP into the root web folder, but I have a lot of existing static content in a separate folder.

    How does WP determine that a URL request is for WP content or static content? I have a problem where some of the static URLs are being turned into 404's by Wordpress (it displays the WP 404 template), even though the static file is there.

  2. #2
    SitePoint Zealot atetlaw's Avatar
    Join Date
    Feb 2007
    Location
    Melbourne, Australia
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK here I go answering my own question. I take it it works because of mod_rewrite:

    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    So if there's no file or directory at that URL, then pass all URLs to index.php?

  3. #3
    SitePoint Zealot jimmy85's Avatar
    Join Date
    Aug 2009
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmmm, I can still see or directly access a static file (on a separate folder) that is not a WP file on a basic WP install. Nothing done or tweaked. I just tested it now.

    So yeah, maybe just wrong path or filename.

  4. #4
    Non-Member thewebhostingdir's Avatar
    Join Date
    Oct 2005
    Posts
    703
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    for example:

    you have a domain.com and public_html directory. You have a public_html/test folder with static contents, and you installed wordpress in public_html (main root folder).

    You can have a .htaccess in test folder. In this case, you would have 2 htaccess files, one in test and one outside test (for wp). Now, when your pages from test folders are browesed, browser will first detect htaccess in test folder, and not in public_html folder. So, the rewrite rule set by wordpress does not affect your static URL's

  5. #5
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •