Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Testing and tuning a live TXP site
Hi,
I’ve developed a website locally and have uploaded it to the web. Now I want to tune the site and let the contributors fill it with content but not for others to see it unless they enter the direct URL.
So what I did (after reading the forum) is putting a splash screen (index.htm) in my root as index.html is usually served over the index.php. Well in my case this didn’t work, it still served the php file.
What I did is adjust the .htaccess file to this:
DirectoryIndex index.htm index.php
#Options +FollowSymLinks
#RewriteBase /relative/web/path/
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) – [PT,L]
RewriteRule ^(.*) index.htm
</IfModule>
#php_value register_globals 0
It now serves the index.html file first and the index.php when I enter the URL directly but when I go to a section like contact it shows my index.html. This is probably due to my RewriteRule but I have no clue how to do it right.
Hope someone can help!
Offline
Re: Testing and tuning a live TXP site
Howdy howdy,
Whenever I do a site upgrade I uncomment a snippet like so:
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$
RewriteRule ^(.*)$ maintenance.html
Sub in your IP and all is well in the jungle.
P.S. — just put this up on TextSnippets since I always forget this things, voila
Offline
Re: Testing and tuning a live TXP site
thanks! I got it working by using your .htaccess code and using messy URL’s.
Offline
Re: Testing and tuning a live TXP site
messy URLs? works fine with clean URLs for me… what happens when you do it?
Offline
Re: Testing and tuning a live TXP site
When i use clean URLs by going to www.mysite.com/contact it says The requested URL /contact was not found on this server.
So this is what my .htaccess now looks like:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REMOTE_ADDR} !^1\.1\.1\.1$
RewriteRule ^(.*)$ index.htm
</IfModule>
Offline
Re: Testing and tuning a live TXP site
Ah! The maintenace redirection should happen first. Try:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REMOTE_ADDR} !^1\.1\.1\.1$
RewriteRule ^(.*)$ index.htm
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
# not sure why below 2 are missing from yr htaccess, part of std TXP htaccess
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*) index.php
</IfModule>
edit: added two more lines that should be there! copy/paste error?
Last edited by jamiew (2007-01-10 21:55:12)
Offline
Re: Testing and tuning a live TXP site
Thanks!!!! works perfect!
Offline
Pages: 1