Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#37 2006-07-13 13:26:41
- jbruce
- New Member
- Registered: 2006-07-13
- Posts: 2
Re: Post your Clean URL .htaccess tweaks here
Noticed after the fact – sorry :)
It was early here.
Offline
Re: Post your Clean URL .htaccess tweaks here
To follow on from rloaderro’s tips on getting clean URLs working under the Apache install in OSX – if you are using the default “Webserver” directory under the main “Library” directory to host your files (i.e. the default location for localhost or 127.0.0.1) you need to also edit your httpd.conf to have ‘AllowOverride All’ under the apropriate section.
I used the .htaccess settings listed above by <b>thomasarie</b> and it works like a charm.
“Absorb what is useful, Discard what is not, Add what is uniquely your own” – Bruce Lee
Offline
Re: Post your Clean URL .htaccess tweaks here
Could someone help me with this:
I want to educate http://mysite.com/news to http://mysite.com, since I display news on the home page.
I thought of something like this: RewriteRule ^news$ http://localhost/
But doesn’t work right away, I think it conflicts with the other rules.
I have the standard .htaccess file:
<code>
#DirectoryIndex index.php index.html
#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.php
</IfModule>
#php_value register_globals 0
</code>
edit: sorry for the missing linebreaks in the code, can’t get them in for some reason…
Last edited by jan (2006-09-14 16:10:23)
Kensington TXP powered rock
Offline
Re: Post your Clean URL .htaccess tweaks here
jan,
In the admin area, under sections, look for On front page? for the news section. If you toggle Yes, then the news section will appear on the front page.
We Love TXP . TXP Themes . TXP Tags . TXP Planet . TXP Make
Offline
Re: Post your Clean URL .htaccess tweaks here
Oh but that’s not exactly what I meant to say, maybe I didn’t make myself clear..
News is already being displayed at my home page (site root) but I would like to actually redirect “page.com/news” to just page.com, so that the url in the browser’s address bar actually changes to that.
input: page.com/news
rewrite: page.com/news —> page.com
output: homepage with just page.com in the address bar
Kensington TXP powered rock
Offline
#42 2006-09-25 14:35:56
- textpatternZoo
- New Member
- Registered: 2006-09-24
- Posts: 7
Re: Post your Clean URL .htaccess tweaks here
Working fine on sourceforge at the moment. With the original it doesn’t work. I just added the “ RewriteBase / “ to the original, and turned off the globals.
Textpattern version: 4.0.3 (r1188)
PHP version: 4.3.10
Server time: 2006-09-25 07:40:48
MySQL: 4.1.21-standard
Locale: en_GB.UTF-8
Server: Apache/1.3.33 (Unix) PHP/4.3.10
Apache version: Apache/1.3.33 (Unix) PHP/4.3.10
PHP mode: apache
Operating System: Linux 2.6.17.4
.htaccess file contents:
————————————
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) – [PT,L]
php_value register_globals off
RewriteRule ^(.*) index.php
————————————
Last edited by textpatternZoo (2006-09-25 14:45:23)
Offline
#43 2006-09-26 23:19:06
- NyteOwl
- Member
- From: Nova Scotia, Canada
- Registered: 2005-09-24
- Posts: 539
Re: Post your Clean URL .htaccess tweaks here
php_value register_globals off
This won’t work (php_value) if PHP is implemented as cgi or fastcgi rather than an Apache module. You’ll need your own php.ini or use a function like setini().
Obsolescence is just a lack of imagination. / 36-bits Forever! / #include <disclaimer.h>;
Offline
#44 2006-09-27 00:58:44
- textpatternZoo
- New Member
- Registered: 2006-09-24
- Posts: 7
Re: Post your Clean URL .htaccess tweaks here
In sourceforge PHP support is provided using Apache’s mod_php.
Offline
Re: Post your Clean URL .htaccess tweaks here
saccade wrote:
I also got a Error-500-message using the .htaccess-settings provided by the textpattern setup… I tried zems answer …and it works now.
Wow. I would have perished without this forum’s thread. I had trouble transfering mysql tables with a new host and assumed my trouble was there. Eight hours later a single keystroke solved everthing. If this is common, maybe the default txp htaccess file could include a note.
original htaccess-file includes:
RewriteRule ^(.*) index.php
modified:
RewriteRule ^(.*) /index.php
Last edited by mwillse (2006-10-18 07:07:26)
Offline
Re: Post your Clean URL .htaccess tweaks here
It already does, it’s the line with RewriteBase that is commented out. Some people need it, for other people it breaks things. The FAQ has an entry that expains what you can try if it doesn’t work out of the box.
Offline
Re: Post your Clean URL .htaccess tweaks here
Should I use RewriteBase
instead of /index.php
? Are there times when they wouldn’t behave the same?
Looking at the faq item you mentioned, I wouldn’t have thought it applied to me had my google or forum searches lead me there.
I got an error 500, not 404. I also started using txp after clean urls were the standard. Though I’ve used .htaccess before for basic redirects, I thought this file was an essential part of txp, not just necessary for clean urls. I’m sure that some other users aren’t even aware of what htaccess does, or that lines beginning with # are commented out options.
Thanks for clarifying this even further…
Offline