dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Under Construction Editing Question

  1. #1
    Join Date
    May 2017
    Posts
    2

    Under Construction Editing Question

    Hello everyone! I'm trying to develop my website but, I don't know how to edit my site without having to pull down my under construction page and opening the site to the public while I edit through my admin page. Is there a way to keep the index.html construction page up and be able to bypass it to view and edit the site while keeping it hidden from the public? Any help is appreciated... thank you!

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    22,146
    Most typically you would copy the files down to your development computer and edit/run/view it there. If you need server-side processing, there are a number of ways to run a web server and related processes on your local computer.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #3
    Join Date
    May 2017
    Posts
    2
    Quote Originally Posted by NogDog View Post
    Most typically you would copy the files down to your development computer and edit/run/view it there. If you need server-side processing, there are a number of ways to run a web server and related processes on your local computer.
    Thanks for the reply NogDog! My father already set up the script on his private server for editing and testing so I guess that was the way to go. Thanks again!

  4. #4
    Join Date
    May 2016
    Location
    Southern California
    Posts
    81

    Just in case of emergency

    In case of emergency, when i need to do maintenance on a server, I have this setup in my htaccess, you need to have mod_rewrite enabled.

    Code:
    <IfModule mod_rewrite.c>
    # Maintenance mode
    RewriteEngine On
    
    # If viewing locally, maintenace will skip this rewrite rule
    RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1
    
    # Change to Your public ip address below, to skip this rewrite for your IP
    # Comment out to see what is seen by the public.
    RewriteCond %{REMOTE_ADDR} !^Your\.IP\.Add\.Ress
    
    RewriteCond %{DOCUMENT_ROOT}/maintenance.php -f
    RewriteCond %{DOCUMENT_ROOT}/maintenance.enable -f
    RewriteCond %{SCRIPT_FILENAME} !maintenance.php
    
    RewriteRule ^.*$ /maintenance.php [R=503,L]
    
    ErrorDocument 503 /maintenance.php
    Header Set Cache-Control "max-age=0, no-store"
    </IfModule>
    What this does is:
    1. If the remote address is not your ip (or any number of ip's you choose to add)
    2. And maintenance.enable and maintenance.php files are present
    3. Then redirect with 503 error to the maintenance.php page.

    Create a maintenance.php file, with your "under construction" info. Upload to server.
    Next, create a empty text file named maintenance.enable, with .enable being the extension (not .txt). Upload it to the server, now the public will see your maintenance.php page.

    When your done with maintenance, simply change the extension from .enable to .disable.

    I usually enable maintenance, during uploading of new files or if troubleshooting unexpected issues with the server. Let me know if you have questions.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles