Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-01-17 01:20:13
- flox
- New Member
- Registered: 2006-01-17
- Posts: 2
URL rewriting without mod_rewrite [solution]
My hosting provider is “www.free.fr”.
It does not support Apache module “mod_rewrite”.
I googled and I hacked some files. And I finally found a “nice and efficient” solution:
(solution for TXP 4.0.3)
1. Replace the ‘/.htaccess’ file with this single line:
<code> ErrorDocument 404 /</code>
If it does not work, you can try:
<code> ErrorDocument 404 /index.php</code>
or if textpattern is installed in a sub-directory:
<code> ErrorDocument 404 /subdir/index.php</code>
2. Add a line in ‘/index.php’ file, before line {<code>include $txpcfg[‘txpath’].’/publish.php’;</code>} :
<code> header(‘Status: 200 OK’); header(‘HTTP/1.0 200 OK’);</code>
Then you login as administrator and set the ‘site preferences’ / ‘URL format’ as you want.
Eg: <code>section/id/title</code>
It works!
Moreover, the HTTP status code is 200. It means it’s OK for referencing on search engines.
You can check the HTTP status code on this page:
http://www.seoconsultants.com/tools/headers.asp
I hope it will help someone.
—
Florent
Last edited by flox (2006-01-17 01:22:22)
Offline
Re: URL rewriting without mod_rewrite [solution]
Textpattern already explicitly sends a 200 OK header.
You will have a problem wih POSTs to your site (like comments) if you are using Apache.
The same/similar pocedure (including how to get comments working) is described on the weblog:
http://textpattern.com/weblog/135/partly-messy-clean-urls-without-modrewrite-experimental
Offline
#3 2006-01-17 13:31:23
- flox
- New Member
- Registered: 2006-01-17
- Posts: 2
Re: URL rewriting without mod_rewrite [solution]
ok,
Thank you for this precision. I did not find this article.
—
Florent
Offline