Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-01-10 09:45:51

maarten
Member
From: Netherlands
Registered: 2005-02-19
Posts: 130
Website

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

#2 2007-01-10 18:29:49

jamiew
Archived Plugin Author
From: NYC
Registered: 2005-01-08
Posts: 74
Website

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

#3 2007-01-10 21:16:34

maarten
Member
From: Netherlands
Registered: 2005-02-19
Posts: 130
Website

Re: Testing and tuning a live TXP site

thanks! I got it working by using your .htaccess code and using messy URL’s.

Offline

#4 2007-01-10 21:24:16

jamiew
Archived Plugin Author
From: NYC
Registered: 2005-01-08
Posts: 74
Website

Re: Testing and tuning a live TXP site

messy URLs? works fine with clean URLs for me… what happens when you do it?

Offline

#5 2007-01-10 21:43:37

maarten
Member
From: Netherlands
Registered: 2005-02-19
Posts: 130
Website

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

#6 2007-01-10 21:53:33

jamiew
Archived Plugin Author
From: NYC
Registered: 2005-01-08
Posts: 74
Website

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

#7 2007-01-11 16:23:09

maarten
Member
From: Netherlands
Registered: 2005-02-19
Posts: 130
Website

Re: Testing and tuning a live TXP site

Thanks!!!! works perfect!

Offline

Board footer

Powered by FluxBB