Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2006-03-12 20:37:55

Jack
Member
Registered: 2005-10-10
Posts: 14

Re: Directory of article page?

sorry, what I meant was that both “blog” and “writings” are sections. “example-blog-entry” would be an article in the blog section

Offline

#14 2006-03-12 20:47:51

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

Re: Directory of article page?

I see you’ve got some confusion over sections versus articles. Sections are like “folders”, articles are the individual articles you’d write. i.e: I might have a section called “blog”, which contains all my blog entries. So when I want the index for my blog, I’d ask for domain.com/blog, but when I want a specific article in my blog, I’d ask for domain.com/blog/article-name.

> “…but then I still don’t understand why my relative links were broken, if only the single index.php is used.”

Because, as far as your browser is concerned, index.php has nothing to do with it. It sees “domain.com/blog/5/about-me” as if you had a file named “about-me” inside a folder named “5”, inside a folder named “blog”. Your browser is what figures out where to look for files, so if you use a relative url “script-name”, it will think you’re inside “domain.com/blog/5”, so it asks the server for “domain.com/blog/5/script-name”. Which of course, doesn’t exist.

As far as the server is concerned, when your browser asks for domain.com/blog/5/about-me, it first looks for a file named “.htaccess”. This file contains rules and guidelines for the server to follow. Inside the .htaccess file that comes with Textpattern, it tells the server that if it can’t find a physical folder or file, to pass the request to Textpattern, and Textpattern handles it from there.

In the case of “domain.com/blog/5/about-me”, your browser would ask the server for “domain.com/blog/5/about-me”, but of course, this file and these folders don’t exist. So the server knows from .htaccess to instead tell Textpattern to handle the request for “domain.com/blog/5/about-me”.

If that’s still confusing, don’t worry about it too much, you’ll figure it out as you go along. Just remember that starting slash rule for external files (scripts, images, etc) and you’ll do fine.

Offline

Board footer

Powered by FluxBB