Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-11-07 00:07:21

uselessness
Member
From: Albuquerque, NM
Registered: 2006-11-06
Posts: 17
Website

.htaccess Clean URL help needed (surprise, surprise)

I’ve used TXP for several years without any trouble. Today, I switched servers. I’m still hosted by the same company, but they moved my site to another system, with a newer version of PHP (5.0.4). I was able to copy my database and all my files over, no problem. I figured while I was at it, I might as well upgrade Textpattern from 4.0.3 to 4.0.4.

Everything’s running, everything’s fine. Except for clean URLs. I never had trouble with this before, my .htaccess file worked right out of the box. Now something’s broke. Here’s my diagnostic info:

Textpattern version: 4.0.4 (r1956)
Last Update: 2006-11-06 19:03:13/2006-11-06 19:02:19
Document root: /home
$path_to_site: /home/[MYDOMAIN]
Textpattern path: /home/[MYDOMAIN]/textpattern
Permanent link mode: year_month_day_title
Temporary directory path: /tmp
Site URL: www.[MYDOMAIN].com
PHP version: 5.0.4
Server Local Time: 2006-11-06 16:59:33
MySQL: 4.1.20
Locale: en_US.UTF-8
Server: [Secure NsHosts]
Apache version: [Secure NsHosts]
PHP Server API: apache2handler
RFC 2616 headers:
Server OS: Linux 2.6.9-34.0.2.ELsmp

Pre-flight check:
————————————
Clean URLs are only supported by Apache, use at your own risk.
Clean URL test failed.
————————————

.htaccess file contents:
————————————
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /

<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

————————————

I’ve tried everything on the FAQ page, and the forum post it links to. I’ve been all through the “Post your Clean URL .htaccess tweaks here” thread, to no avail. Is there anything else I can try? Besides migrating back to my old server?

Can someone explain to me, technically, what it means for a server to “support clean URLs?” Maybe it’s just something I can request my host to activate on their end, something that the old server was configured for but the new one isn’t. Thanks for your help, whatever you can offer.

Offline

#2 2006-11-07 01:09:36

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: .htaccess Clean URL help needed (surprise, surprise)

It means having mod_rewrite available. If you remove <IfModule mod_rewrite.c> and </IfModule> from the .htaccess, do you get a 500 error? That would mean mod_rewrite is not enabled (and so you should contact your host).

Offline

#3 2006-11-07 15:15:27

uselessness
Member
From: Albuquerque, NM
Registered: 2006-11-06
Posts: 17
Website

Re: .htaccess Clean URL help needed (surprise, surprise)

Thanks for the tip. I’ve actually already tried this — I don’t get an error. And my host tells me that mod_rewrite is enabled. What else could be the problem, do you suppose?

I hope I can get this worked out. As I mentioned, clean URLs worked just fine on the other server, same web host. Nothing major should be changed now.

Offline

#4 2006-11-07 17:51:39

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: .htaccess Clean URL help needed (surprise, surprise)

Which tweaks have you tried already?

Offline

#5 2006-11-07 18:07:39

uselessness
Member
From: Albuquerque, NM
Registered: 2006-11-06
Posts: 17
Website

Re: .htaccess Clean URL help needed (surprise, surprise)

A bunch.

I’ve uncommented the lines in the .htaccess; I’ve tried them one at a time, two at a time, and all three together.

I’ve modified the “RewriteRule ^(.*) index.php” line to include a slash before the filename.
I also replaced that line with “RewriteRule ^(.*) index.php/$1”.

I did a bunch of random fiddling too, just trying to figure something out, hoping I might stumble on a solution. I didn’t. :-) I have the permissions for the .htaccess file set to 644, but I’ve also experimented with 744. For some reason, my FTP client automatically sets it to 000 when I upload it, and that doesn’t work either. Do permissions matter for this file?

Offline

#6 2006-11-07 19:42:00

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: .htaccess Clean URL help needed (surprise, surprise)

No, permissions shouldn’t matter; mine is 644 and it works fine.

When you say they don’t work, what does that mean? Do you get a 404 not found error? or something else?

Offline

#7 2006-11-07 20:18:31

uselessness
Member
From: Albuquerque, NM
Registered: 2006-11-06
Posts: 17
Website

Re: .htaccess Clean URL help needed (surprise, surprise)

All I mean is that I keep getting “Clean URL test failed” in my pre-flight check.

Right now, I have to access my site at IP.NUMBER/MY_ACCOUNT because I haven’t pointed my domain to it yet. When I load that URL, I get a 404 error. I can login without problem at IP.NUMBER/MY_ACCOUNT/textpattern/ .

I set my URL style to “messy,” and no longer got a 404 error. But I really don’t want to use messy URLs, particularly because other people may have existing permalinks to my site that I don’t want to break.

Could accessing my site by domain name instead of by IP fix the problem, do you suppose?

Thanks for all your help. Your patience is legendary.

Offline

#8 2006-11-08 00:12:58

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: .htaccess Clean URL help needed (surprise, surprise)

U,

The Clean URL test in diagnostics fetches a page based on your Site URL setting, and makes sure that it works correctly. If your Site URL is incorrect, the test will fail.

There are any number of Apache configuration options and bugs that can affect the way mod_rewrite and htaccess works. The suggestions in the FAQ, and those linked from that page, are about the extent of our knowledge on the subject. Your hosting company’s tech support people know much more than we do about the way their servers are configured.


Alex

Offline

#9 2006-11-08 00:25:59

uselessness
Member
From: Albuquerque, NM
Registered: 2006-11-06
Posts: 17
Website

Re: .htaccess Clean URL help needed (surprise, surprise)

Okay, I think you just solved my problem then. My Site URL is not working because I haven’t pointed my domain name to this site yet.

Since clean URLs worked on my old server, same web host, I have no reason to believe they won’t once I update my DNS. I guess that’s just the problem. Thanks for all your help!!

Offline

Board footer

Powered by FluxBB