Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
404, .htaccess and RewriteRule
Hi community,
I’m having this url scheme:
site.com/section/category/article-title?my_elements2
And I’d like to transform it to:
site.com/section/category/article-title/2
Struggling with .htaccess and don’t get any better than a 500 error or nothing happens at all…
Here’s the line I’m adding above any other Txp RewriteCond
#RewriteRule ^/sectionA/(.*)/(.*)/([0-9]+)$ index.php?s=sectionA&c=$1&$2?my_elements=$3 [L]
One thing is sure here: My regex is not better than yours…
Last edited by hablablow (2011-03-03 18:11:27)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: 404, .htaccess and RewriteRule
Probably not the issue, but remove the first /
:
^sectionA/(.*)/(.*)/([0-9]+)$ ...
Also, I think there is something wrong here:
s=sectionA&c=$1&$2?my_elements=$3
The thing in $2 doesn’t look like a query string, and then, there is also a second ?
that doesn’t seem necessary.
Offline
Re: 404, .htaccess and RewriteRule
Juan you are right…
My final rule is :
^sectionA/([^/]+)/([0-9]+)$ index.php?s=sectionA&c=$1&my_elements=$2 [L]
This will translate into:
http://www.domain.com/sectionA/category/the_value_of_my_elements
By the way is there a way to get the aricle title in the way Txp builds it’s urls, before it’s translated to clean urls ?
Or will Txp always build it’s url based only on the id of the article ?
Thanks !
Last edited by hablablow (2011-03-04 22:55:29)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Pages: 1