Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-21 02:29:46

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

URL Customization

I need your advice about url formats and structures. I have found a way to make txp produce Custom URLS like the ones below. You may be shocked if I give you the solution. Its very very simple. I used the URL-only title to assign each URL by typing in category and sub-category names and a file name. i.e. I typed */automobiles//ford/mercury/index.html*directly in the URL-only-title box available in the “advanced options” of the “Write” page.

http://www.domain.com/automobiles//ford/mercury/index.html

which is basically http://www.domain.com/section//category/sub-category/index.html)

and

http://www.domain.com/automobiles//ford/mercury/milan/index.html

which is basically http://www.domain.com/section//category/sub-category/sub-category/index.html)

The only problem is that I’m unable to avoid an extra slash after the section (i.e. autombiles<strong>//</strong>ford). Why am I using the extra-slash? If I dont use the extra slash textpattern dismisses it as an invalid URL. The question is whether such urls are search friendly or not? SEO people please advice.

p.s. Am I the first one to come up with such a solution for custom URLs? Because I’m shocked myself by the simplicity of the solution. I cant help but smile when I see so many lines of code written for customizing urls through mod-rewrite :) Its not that I’m mocking at the developers. Its just that it feels wierd to find such a simple solution.


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#2 2005-11-21 08:23:18

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: URL Customization

Unless I misunderstand here, you’re suggesting that a person can simply leave messy URLs as the default setting and then manually edit that URL-only field for each article you write? When you think about it like that (manually adding that long URL for every article) then the comparison that you allude to between the “lines of code” needed in .htaccess mods to this manual method does not hold up; I’ll take the one-time rewrite mods any day, speaking from a simple writing/editing standpoint.

Also, that’s a lot of extra characters to dump into the db’s “title” field, no?

EDIT: Wait, I notice that you are pointing to a .html file at the end…so maybe you’re talking about static content outside of the database, sitting on the server itself? I’m a little confused.

Last edited by Destry (2005-11-21 08:31:12)

Offline

#3 2005-11-21 08:54:07

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: URL Customization

<blockquote>> Destry wrote:
>you’re suggesting that a person can simply leave messy URLs as the default setting and then manually edit that URL-only field for each article you write?
</blockquote>

No you dont have to turn to Messy URLS. If you want to fully understand what I am saying, try the following in a textpattern website….

1) Change the URL mode to /section/title mode.
2) Create an article
3) Before publishing the article customize the URL-only-title. Enter this chunk of code as it is >> (<code>/testing/this/url/scheme/urls.html</code>) (not including the brackets ofcourse)

4)Now go to the website and open the article and be shocked because the url will be something like …

http://yourdomain.com/yoursection//testing/this/url/scheme/urls.html

I hope I was more clear this time. But, you were right in a way. You have to manually assign the url for each article you write. It infact in depends on your needs. I use textpattern only for static websites and I would like to customize each articles URL. Infact I consider it as part of the article creation process. So its not a hassile, because the end results are good. (I get my own url).

Edit:
<blockquote>
Wait, I notice that you are pointing to a .html file at the end…so maybe you’re talking about static content outside of the database, sitting on the server itself? I’m a little confused.
</blockquote>

No I am not using any static files. Looks like textpattern doesnt mind storing some extra characters in thier URL-only-title fields. :)

Last edited by creativesplash (2005-11-21 09:10:47)


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#4 2005-11-21 09:20:44

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,909
Website

Re: URL Customization

Well, for the record, I have clean URLs working fine and wouldn’t need this, nor would I want to go this route for the manual labor aspect of it, as I mentioned before. However, I did try what you are talking about and it does work as you describe, but if I’m “shocked” about anything, it’s that you seem to think this is useful somehow.

I’m sure I don’t understand, sorry. For example, you are pointing to an .html file, why? The article still goes in the database, at least it did for me, so in extension to that thinking I don’t grasp why there’s this distinction between dynamic and static sites. If the article had been posted as a file on the server, then that would have been something cool, something indeed shocking.

Don’t ge me wrong, creativesplash, I’m sure you have something going on and I just don’t see it. Maybe instead of pushing this as a revolutionary approach to clean URLs, describe more clearly a case situation where it would be practical. That might help me (and maybe others), because at the moment I don’t see where this is practical for many people.

Offline

#5 2005-11-21 09:25:42

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

Re: URL Customization

I tried this and it doesn’t work.

Where I have Txp installed:

http://localhost/txp-stable/

I entered the following as the URL-only title of one my articles:

/testing/this/url/scheme/urls.html

On the site, the permurl I get back is:

http://localhost/txp-stable/article//testing/this/url/scheme/urls.html

Having the extra slash merely suppresses the 404 error. Txp just displays the front page.

Offline

#6 2005-11-21 09:39:43

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: URL Customization

Okie, I had skipped a few points.

1) Along with textpattern my client is using static files which dont require changes (he doesnt want me to touch them). So I let them remain as static files (.html files).

Since I wanted the website url scheming to look even I used .html as a suffix.

2) I wanted to bring in url structural hierarchy. Like the example … domain.com/automobiles/ford/mercury/. Since textpattern doesnt allow custom urls any other way (and since my knowledge in mod_rewrite is nil) I took the easy way out.

3) My only doubt was that if Search Engines would index such an URL.


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#7 2005-11-21 09:45:31

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: URL Customization

> Mary wrote:

>Having the extra slash merely suppresses the 404 error. Txp just displays the front page.

Did you select the /section/title url scheme?


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

#8 2005-11-21 13:53:24

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: URL Customization

> creativesplash wrote:

3) My only doubt was that if Search Engines would index such an URL.

I remember the now-gone literary moose site having some rather unusual characters in its URLs. So I suppose it’s ok for GYM.

//w&

Last edited by wet (2005-11-21 13:55:39)

Offline

#9 2005-11-21 16:50:25

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: URL Customization

As someone who spent a great dealing of time learning how to configure cruft-free urls in movable type, I can’t help but think there is something wrong with this picture.

Offline

#10 2005-11-21 19:22:05

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

Re: URL Customization

Did you select the /section/title url scheme?

Yep. I tried it in both the latest stable and dev versions. :/

Offline

#11 2005-11-21 19:27:29

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: URL Customization

According to RFC 2396, paragraph 3.3, path segments are separated by a single slash character. Path segments must not contain “/”.

The path may consist of a sequence of path segments separated by a single slash “/” character. Within a path segment, the characters “/”, “;”, “=”, and “?” are reserved.

The double slash sequence is used as the delimiter separating the so called “authority” (aka the server) from the path inside the authority. According to this specification, the part of the URI up to the rightmost double slash sequence is considered to reference the “authority”. Paragraph 4.3 of RFC 2396 is very precise about that rule:

The greedy algorithm is used for disambiguation: the left-most matching rule soaks up as much of the URI reference string as it is capable of matching. In other words, the authority component wins.

That given, your URL strings are considered invalid per RFC 2396. I’d suggest to prefix your dirifed article titles with a single character like ‘-’ or ‘~’ resulting in URLs like that: http://www.example.org/music/-/rock/beatles/abbey-road.html. IMHO, this would satisfy Tim Berners-Lee et al.

Google treats ‘-’ as a word delimiter, which would rather help than harm your search engine placements.

//w&

Last edited by wet (2005-11-21 19:40:07)

Offline

#12 2005-11-22 05:37:32

creativesplash
Member
From: Coimbatore, India
Registered: 2005-01-19
Posts: 283
Website

Re: URL Customization

@mary:I’m not sure about whts wrong. Its working perfectly for me (and <a href=“http://forum.textpattern.com/viewtopic.php?pid=87228#p87228”>Destry</a>)

@Wet: This is exactly what I was looking for. Thanx for the tip. After all, its the end that matters :)


“Take a point, stretch it into a line, curl it into a circle, twist it into a sphere, and punch through the sphere.”

— Albert Einstein

Offline

Board footer

Powered by FluxBB