Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-05-09 22:57:54

Kachii
New Member
Registered: 2008-05-03
Posts: 4

Rewriting one page's URL

Here’s the deal:

I have the htaccess file:

#DirectoryIndex index.php index.html

#Options +FollowSymLinks

#Options -Indexes

<IfModule mod_rewrite.c>

RewriteEngine On

#RewriteBase /relative/web/path/

RewriteCond %{REQUEST_FILENAME} -f [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^(.+) – [PT,L]

RewriteRule ^(.*) index.php

RewriteCond %{HTTP:Authorization} !^$

RewriteRule .* – [E=REMOTE_USER:%{HTTP:Authorization}]

</IfModule>

#php_value register_globals 0

And I have an article in section ‘computing’ with the title ‘python’ that I can access through mysite.com/computing/python/
I have used PHP to separate up the article so that different sections of it can be accessed using mysite.com/computing/python/?section=one
But obviously due to SEO I would like to rewrite this url to something like mysite.com/computing/python/section/one
But TXP’s htaccess is greedy, and won’t let me do this, it seems. Either that or I made a typo in my .htaccess.

Does anybody have a solution?

I tried adding a simple rewrite rule to the top of the file, but it didn’t work:

RewriteEngine on
RewriteRule ^tp/computing/python/section/([^/\.]+)?$ http://domain.com/tp/computing/python/?section=$1 [L]

Thanks for your help in advance.

(Why can I not disable textile?)

Last edited by Kachii (2008-05-09 22:59:49)

Offline

#2 2008-05-09 23:14:28

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: Rewriting one page's URL

Kachii wrote:

Why can I not disable textile?

You can use blockcode (bc.), in example. Like this:

This is my codeblock.

Yep.

Offline

#3 2008-05-10 09:58:31

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: Rewriting one page's URL

Try gbp_permanent_link.

It’s pretty customizable and is working fine, after you got your head around it… :)

Z-

Offline

#4 2008-05-10 15:29:01

Kachii
New Member
Registered: 2008-05-03
Posts: 4

Re: Rewriting one page's URL

Zanza wrote:

Try gbp_permanent_link.

It’s pretty customizable and is working fine, after you got your head around it… :)

Z-

I’ve tried that one, it doesn’t work for this type of URL that I’m trying to do, because it’s not a redirection to any specific category or article, it’s just the same static page split up into sections.

Offline

Board footer

Powered by FluxBB