Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-02-06 23:38:04

flamenco
Member
Registered: 2009-01-07
Posts: 18

All pretty links work except one - a mystery [solved]

Hi!
Here’s a small strange occurence that I can’t explain. I have 4.08 running on a Linux system that has PHP in a CGI-wrapper, as opposed to plain Apache.

I had been running a test install of TXP in a subdirectory. I finally got the site looking good. My permanent link mode was /title. I changed my config file for TXP path, and in admin I adjusted Site URL, File Directory Path, and Temporary Directory Path, and copied the files down to the root.

Pretty much everything was great, except for one menu link. With the /title link mode, I expected to get links like this:

http://blahblah.com/contact
http://blahblah.com/home
…. and so on, and all worked fine except for this one:

http://blahblah.com/portfolio

… when I clicked it, the URL in the address bar changed to this instead:
http://blahblah.com/index.php?page=portfolio
…and it went to the homepage instead of the portfolio page, apparently just reading index.php.

I cleared my browser cache, tried another browser too, same thing. I even looked at the database tables to see if there was any cached stuff there, I didn’t find any. I also tried putting a RewriteBase into the HTACCESS, this didn’t do anything.

You know what finally fixed it? I changed the URL-only-title on the article, which had been “portfolio”, a default, to “portfolio-list”, and then it worked fine! I also was able to get it to work fine by using a link mode of /id/title instead of /title. That same link had worked flawlessly in the subdirectory.

I’m utterly mystified. Anybody have any ideas why that would happen?

Thanks!!!!

PS: I had used the suggested .HTACCESS file, with this stuff in it:

————————————
#DirectoryIndex index.php index.html

#Options +FollowSymLinks
#Options -Indexes

<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /folder/

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]

RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*) index.php

RewriteCond %{HTTP:Authorization} !^$
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
</IfModule>

#php_value register_globals 0
————————————————————————————

Last edited by flamenco (2009-02-07 19:05:14)

Offline

#2 2009-02-07 15:45:14

flamenco
Member
Registered: 2009-01-07
Posts: 18

Re: All pretty links work except one - a mystery [solved]

I looked further by using debug, and I can see what’s going on, but I’ve been unable to track it down so far, it’s ugly. It looks like a bug to me, but I can’t pinpoint it – these queries have so many variables that it’s awfully hard to find it. The bad call seems to be using a default. So near and yet so far. Frustrating, although because I have a workaround, I guess it’s cool.

the good call:
select ID,Section from textpattern where url_title like 'portfolio-list' and Status >= 4 limit 1]

the bad call:
select page, css from txp_section where name = 'default' limit 1]

So at least I can rule out server problems, because the call is different.

Offline

#3 2009-02-07 16:38:10

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: All pretty links work except one - a mystery [solved]

flamenco wrote:

… when I clicked it, the URL in the address bar changed to this instead:
http://blahblah.com/index.php?page=portfolio
…and it went to the homepage instead of the portfolio page, apparently just reading index.php.

Are you sure about the ?page= part? Txp doesn’t create URLs like that.
And you don’t happen to have a directory ‘portfolio’?
Otherwise, can you post the full tag trace?

Offline

#4 2009-02-07 19:04:45

flamenco
Member
Registered: 2009-01-07
Posts: 18

Re: All pretty links work except one - a mystery [solved]

Els,
My good friend and mentor, again, you are a genius!!! I officially nominate you as the Olympic Champion of Textpattern Problem Solving.

As it happens, I did have a /portfolio folder. I looked inside, and indeed, I had an HTACCESS file there that was screwing around with Rewrite rules. I had totally forgotten about it, it’s a folder I don’t even use anymore; I’m reading the code, and I see that I was trying to do some redirecting and spam server blocking.

So as you said, Textpattern was not at fault! Interestingly, I was looking through Textpattern code to track the problem down, and strangely enough, I did find places that make “page=” URL’s… there are about half a dozen scripts. These may be very seldom used, some kind of fail-safe default possibly. So this muddied the waters for me while I was hunting.

There is also the warning in TXP admin that cautions about using pretty URL’s in “non-Apache”, which presumably is because of the CGI wrapper rather than plain Apache. But evidently it’s running fine. Maybe there are security concerns I’m not aware of.

In any case, in one week I’ve gone from a stumbling oaf to having a fully functional site, and I even started doing things like form changes and some menu customizing. People talk about the “Eureka” moment when you suddently grasp the system. That was me yesterday.

There are certainly trade-offs in CMS systems. If you have too many built-in features, you usually lose customization ability. But in a highly customizable system, you need to do more research to get it going, and usually write more code. I’m always trying to find a balance. I’m still astounded at what TXP can do with only about 1M of code. It is the smallest CMS I have among the many I have installed. Some of them are big enough that they start to look like MS Office.

And a community matters a lot. I’ve had a lot of helpful responses here. There are plenty of good systems out there, but if people are afraid that the community will be snarky and nasty, they’ll leave even with great technology. I’ll be blogging the good experiences I’m having here.

Thanks a million!!!

Offline

#5 2009-02-07 19:19:27

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: All pretty links work except one - a mystery [solved]

You’re welcome :)

flamenco wrote:

I did find places that make “page=” URL’s… there are about half a dozen scripts.

Really? On my sites I only see ?pg=

Offline

#6 2009-02-07 19:37:24

flamenco
Member
Registered: 2009-01-07
Posts: 18

Re: All pretty links work except one - a mystery [solved]

Els,
That’s the Dutch version. ;) Yes, I think when I turned on messy URL’s, I got something like that, too.

Seriously, I don’t know the details, it’s raw code that I didn’t scrutinize, but if you need some reading that’s relaxing and will put you right to sleep, PM me and I’ll give you the names of the script files. :)

You Rock!

Offline

Board footer

Powered by FluxBB