SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    260
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mod rewrite REMOTE admin IP address to show certain file

    Here's the deal. I'm installing WordPress to a new site, but I need to do maintenance and testing that only I can see and access. No visitors. No spiders. I currently have a countdown page showing, but I want it to still show even after I begin setting up the site.

    I need the mod rewrite rules to show the wordpress index.PHP only to my static IP address, while showing the old, coming soon index.HTML page to everyone else. Here's the default htaccess mod rewrite rules that wordpress currently employs:
    Code:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    Thanks.

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

    DirectoryIndex will allow you to use index.html for your counter and index.php for your WP setup.

    Code:
    DirectoryIndex index.html index.php whatever
    DirectoryIndex will not eliminate the abuse of your <IfModule> wrapper nor the useless RewriteBase and RewriteRule with ^index.\.php which merely duplicates the !-f RewriteCond test.

    Please have a look around here because these directions have been repeated many times. In fact, I believe I have a Standard Rant for the <IfModule>:

    [standard rant #4]
    The definition of an idiot is someone who repeatedly does the same thing expecting a different result. Asking Apache to confirm the existence of ANY module with an <IfModule> ... </IfModule> wrapper is the same thing in the webmaster world. DON'T BE AN IDIOT! If you don't know whether a module is enabled, run the test ONCE then REMOVE the wrapper as it is EXTREMELY wasteful of Apache's resources (and should NEVER be allowed on a shared server).
    [/standard rant #4]

    No, I'm not calling you (or anyone else) an idiot! I am just making the point that a real webmaster would KNOW what the code does that he/she is using. If that were the case, you would already have removed the nonsense that WP had to add to prevent disabling people's websites who don't even know that they don't have mod_rewrite available - the mod_rewrite code would otherwise generate Error 500 pages, not their website pages.

    OMG! My Standard Rant needs more "this is not a flame attack" explanation text than it's saved in repetitive explanations!

    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 Addict
    Join Date
    Jun 2005
    Posts
    260
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help dklynn. I think that'll work out.


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
  •