Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
clean urls on localhost
Hi there,
I want to test my sites with Apache (Win XP) on a local environment using XAMPP.
Now after scanning the various topics about editing .htaccess and so on, I still don’t get clean URLs to work.
These are my diagnostics (with the .htaccess lying in the “project” folder):
PHP-Version: 5.1.1
server_time: 2006-04-07 23:52:54
MySQL: 5.0.18-nt
Regionale Einstellungen: German_Germany.1252
Server: Apache/2.2.0 (Win32) DAV/2 mod_ssl/2.2.0 OpenSSL/0.9.8a mod_autoindex_color PHP/5.1.1
Apache-Version: Apache/2.2.0 (Win32) DAV/2 mod_ssl/2.2.0 OpenSSL/0.9.8a mod_autoindex_color PHP/5.1.1
php_sapi_mode: apache2handler
os_version: Windows NT 5.1
Inhalt der .htaccess-Datei:
————————————
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
RewriteBase /project/
< IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]
RewriteRule ^(.*) /project/index.php < /IfModule>#php_value register_globals 0
————————————
I’ve got another .htaccess in the server root, but that shouldn’t interfere, right?
Now what could be the cause for clean urls not to work? If someone knows, I would appreciate quick help very much.
Thanks in advance!
Diagnosis:
Version Textpattern: 4.0.3 (r1188)
PHP-Version: 4.4.1
Hosting: all-inkl.com
Offline
#2 2006-04-07 22:16:25
- marios
- Archived Plugin Author
- Registered: 2005-03-12
- Posts: 1,253
Re: clean urls on localhost
I think you have forgotten to enable mod_rewrite in your apache configuration file,
Open httpd.conf (Inside folder Apache > conf) , and uncomment the line for the relevant Server module.
It’s somewhere at the beginning,
#LoadModule rewrite_module modules/mod_rewrite.so
(Just remove the hash Symbol in the front and resave, then restart Apache before looking at your diagnostics again.)
Without that Servermodule, TXP can not do all the URL magic.
Ah, don’t forget allso to switch register globals off, if you are using 4.0+
regards, marios
Last edited by marios (2006-04-07 22:26:02)
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
Re: clean urls on localhost
unfortunately, that’s not the case. Enabling mod_rewrite was one of the first things I did. Also, there is no register_globals in PHP5 any longer.
Thanks anyway, hoping for more suggestions…
Diagnosis:
Version Textpattern: 4.0.3 (r1188)
PHP-Version: 4.4.1
Hosting: all-inkl.com
Offline
Re: clean urls on localhost
In that same file have you checked for <code>AllowOverride</code>? If it is commented out then it is inactive, which is how mine is set, but if the comment has been removed it should be set to <code>AllowOverride All</code>.
Also, whilst I can’t say I had any problems with Xampp, I do prefer Apache2Triad which I find more flexible. You can choose a PHP4 or PHP5 install and they tend to keep things up-to-date. Just an idea.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#5 2006-04-07 23:22:55
- zem
- Developer Emeritus
- From: Melbourne, Australia
- Registered: 2004-04-08
- Posts: 2,579
Re: clean urls on localhost
Now what could be the cause for clean urls not to work?
“Not working” could mean anything – server unplugged, etc. Please be specific if you want help.
I’ve got another .htaccess in the server root, but that shouldn’t interfere, right?
Another .htaccess file could easily interfere.
.htaccess and mod_rewrite behaviour is highly dependent on the server configuration and environment. Don’t assume anything. Textpattern’s .htaccess will work in a typical Apache vhost environment as set up by most web hosting companies. But there are a million different ways of configuring Apache.
You should start by confirming that mod_rewrite is installed and working in the directory in which you’ve installed Textpattern.
Also, there is no register_globals in PHP5 any longer.
Not true. It’‘ll be eliminated in PHP 6, but is still present in 5.0 and 5.1.
Last edited by zem (2006-04-08 01:51:44)
Alex
Offline
#6 2006-04-07 23:50:18
- marios
- Archived Plugin Author
- Registered: 2005-03-12
- Posts: 1,253
Re: clean urls on localhost
There is one thing you can do to find out more, go to the php.info pane,scroll down to the apache 2 handler header,
in the last table row, you should see a list with all the loaded modules,if it is not there something is wrong, It should be in the compiled binaries folder by default though AFAIK.
BTW.: Isn’t the Appache and sql version a little brand new ?
Im not saying, that tXP couldn’t work these, but it would be rather hard to find a hosting company that do support these
brand new versions.(Better would be to select an older XAMPP package, that matches a little the specs of the hosting company you intend to work with.)
Allso , make sure you set up virtual hosting environement, when testing multiple sites, else nothing but wrong conclusions.
If you had just dropped your Site folder inside htdocs,it is most likelely not working , even with mod_rewrite, since your doc root does not match the only doc root that would be available, which is htdocs.
regards, marios
Last edited by marios (2006-04-08 00:28:08)
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
Re: clean urls on localhost
“not working” means that I get a 404 error when clicking on an article link with clean urls activated.
well ok, I was wrong with register globals …it’s not eliminated but it is off by default in the newer distributions.
@thebombsite:
the current xampp version actually features a php version switcher and I’m now on 4.4.1. the distribution seems to be quite up to date.
mod_rewrite is installed for sure. this is what it says in httpd.conf (changed AllowOverride to “all”):
<code>
< Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
< / Directory>
</code>
Diagnosis:
Version Textpattern: 4.0.3 (r1188)
PHP-Version: 4.4.1
Hosting: all-inkl.com
Offline
#8 2006-04-08 22:10:59
- marios
- Archived Plugin Author
- Registered: 2005-03-12
- Posts: 1,253
Re: clean urls on localhost
As Zem sayd, the information that you provide is not sufficient, thinks like:
1) Your full diagnostics
2) where did you put the document root of your site
3) and may be some other things, like if you are using virtual hosting
regards, marios
Last edited by marios (2006-04-08 22:13:14)
⌃ ⇧ < ⎋ ⌃ ⇧ >
Offline
Re: clean urls on localhost
Hi Birgit,
try an .htaccess file with the following content:
RewriteEngine On
RewriteRule .* - [F]
If you continue to get 404s then mod_rewrite or .htaccess is not working (for that directory/server/…). If you get 403 Forbidden, then mod_rewrite and .htaccess are generally working in that directory, but something else is interfering (like possibly this issue: http://textpattern.com/faq/173/password-protected-directories-with-htaccess).
It’s possible that you’ll find better help on apache-issues on an apache-related forum. Do share your solutions with us, though.
Last edited by Sencer (2006-04-08 23:31:10)
Offline
#10 2006-04-22 10:23:18
- kishore
- Member
- Registered: 2005-09-29
- Posts: 14
Re: clean urls on localhost
Actually I wanted to ask for help for the same problem. I faced a similar problem with my local version of XAMPP. What happened was error pages saying “Page cannot be displayed”.
But after that, I uncommented the line for the rewrite Server module. What happened then was there would be no error pages, but when the section links and post links are clicked, although the url changes to the new location in the address bar, the page remains as it is.
This is the configuration:
+ Apache 2.0.52
+ MySQL 4.0.21
+ PHP 5.0.2 + PHP 4.3.9 + PEAR
Any remedy for this?
Last edited by kishore (2006-04-22 10:24:07)
Offline
Pages: 1