SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Hybrid View

  1. #1
    SitePoint Guru Rebirth Studios's Avatar
    Join Date
    Mar 2003
    Posts
    621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need Help with Root Level htaccess

    A client of mine is using apollohosting.com and I accidentally deleted the .htaccess file listed below, which sits in the root level.

    .htaccess
    domain.com
    cgi-bin
    httpsecure
    stats
    I have WordPress setup (domain.com folder) and before the deletion, the pages were working fine, but now when I click them, they're giving me 404 errors.

    I have to assume that there was directive in this root level .htaccess versus the default WP one that lives in domain.com folder.

    Can anyone help me out with what needs to be in this root level file?

    Thanks

  2. #2
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    RS,

    The common WP .htaccess (corrected) is:

    Code:
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME) !-f
    RewriteRule .? index.php [L]
    What I've deleted does NOT belong in their code, i.e., RewriteBase, RewriteCond %{REQUEST_URI} !index\.php and absurdly wasteful <IfModule> wrapper.

    Because you've move your WP installation, you may need to change the RewriteRule to point to /domain.com/index.php.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  3. #3
    SitePoint Guru Rebirth Studios's Avatar
    Join Date
    Mar 2003
    Posts
    621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The issue i'm talking about refers to an .htaccess in the parent folder above domain.com where the wordpress install lives.

    .htaccess (here)
    domain.com (not here, where WP is)
    cgi-bin
    httpsecure
    stats

  4. #4
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    RS,

    Anything "above" a domain is not accessible by HTTP so its .htaccess is not read. Typically, hosts provide a structure like:

    ~account
    -- cgi-bin
    -- www (or public_html)
    ----- subdomains
    ----- add-on domains
    -- logs, etc.

    In this structure, www (or public_html) is where the main domain is located (add-on domains and subdomains are in subdirectories of www).

    IF www is where you're trying to install .htaccess, that's correct (for the main domain, NOT for subdomains/add-ons as they "skip over" the main domain's DocumentRoot).

    Please define your structure - at least where domain.com (registered domain or merely a subdirectory???) is located in this structure.

    Your actual domain name is irrelevant.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  5. #5
    SitePoint Guru Rebirth Studios's Avatar
    Join Date
    Mar 2003
    Posts
    621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, www (domain.com) is where my main domain / wordpress root level would be.

    I uploaded your code to that spot and it works for the pages, but the CSS is not rendering. Without the file, the homepage loads with style, but shows a 404 on all subpages.

  6. #6
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    RS,

    The obvious question is "Where is the css file located (in your physical structure)?" It MUST be in the same place as the WP css file and called in the same manner (it's protected from redirection because of the !-f).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  7. #7
    SitePoint Guru Rebirth Studios's Avatar
    Join Date
    Mar 2003
    Posts
    621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    domain.com/wp-content/themes/alternatewp/style.css is the location of the css. When I browse to it, i'm getting a 404 error. When I FTP to it, I can physically see the file there.

  8. #8
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    RS,

    And your .htaccess is simply the code I repeated for you above?

    index.php is located in the DocumentRoot (at domain.com, NOT wp-content)?

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  9. #9
    SitePoint Guru Rebirth Studios's Avatar
    Join Date
    Mar 2003
    Posts
    621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, both .htaccess and index.php are in the root level.

  10. #10
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by dklynn View Post
    RS,

    And your .htaccess is simply the code I repeated for you above?

    index.php is located in the DocumentRoot (at domain.com, NOT wp-content)?

    Regards,

    DK
    Quote Originally Posted by Rebirth Studios View Post
    Yes, both .htaccess and index.php are in the root level.
    ???

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  11. #11
    SitePoint Guru Rebirth Studios's Avatar
    Join Date
    Mar 2003
    Posts
    621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    These items are in the root level folder structure like this...
    .htaccess (with your code)
    index.php
    /wp-content/themes/alternatewp/css/style.css

  12. #12
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,653
    Mentioned
    19 Post(s)
    Tagged
    3 Thread(s)
    RS,

    Okay, thanks. However, I've got to assume that wp-content is the location of WP's index.php file handler. That means that I was not sufficiently specific in asking for the location of index.php (WP's, not a website welcome like a flash intro). If this is a correct assumption, then you'll have to move the .htaccess to the wp-content directory and make sure that your "flash intro page" links to the WP installation's index.php.

    Well, with that, color me totally confused about your WP installation.

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator


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
  •