Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Changing textpattern root page from assuming 'index.php'
I’ve noticed that txp is designed to assume that it is, and has control of the full directory, if not the full site it is on with the Rewrite rules in .htacess.
My problem is this: I’m on a really slow host, and I’d like to create a static index page which is used for all base URL hits (DirectoryIndex index.html txp.php, et al)
However, I’d like to keep txp:newer and txp:older, etc working – but they use the indrect http://site/?pg=.. notation. I’ve quickly grepped through the functions, but haven’t seen any real easy way of cheating.
Aside from using txp:php or hacking at the functions directly, is there an easy way to tell txp “Hey, you’re not the preferred page; insert your file along with the path!”
Cheers!
Offline
Re: Changing textpattern root page from assuming 'index.php'
looking in pagelinkurl(), it only inserts (the static) index.php in messy mode; I want to support ‘cleanurl’ mode, but with the named file static, so I changed:
return hu . join_qs($keys);
- to -
return hu .‘index.php’. join_qs($keys);
.. however, I am still having a bit of problem making the mod_rewrite magic work with this; for some reason, using a rewriterule of ^$ with a base of / doesn’t work to fall back to DirectoryIndex despite [L]. Grr.
Last edited by textpress (2006-05-15 00:16:54)
Offline
Re: Changing textpattern root page from assuming 'index.php'
While answering my own question, it was kind of evasive; you can rename textpattern from being index.php if you change the name of the file in pagelinkurl(), and your .htaccess respectively.
However, being both lazy, and trusting the webserver more than myself, I’ve forced DirectoryIndex index.html index.php; and:
RewriteBase /
RewrteRule ^$ /index.html [L]
…
This ensures that the root request (anyone who hasn’t bookmarked a section, or other directory,etc) will go to the static page for the root directory only. I generate the page manually by doing one textpattern render request and writing that to the index page for either edits made, or, in the case of future-dated articles, a crontab.
Edit: Forgot the [L] in the above which would fall through to the standard tp rules.
Last edited by textpress (2006-05-15 00:58:55)
Offline