Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-01-21 05:39:15

zeusdidit
Member
Registered: 2007-10-16
Posts: 111

How do I change .htaccess file so section/title goes to just /title?

I’ve been crawled by google and some articles still point to section/title instead of just /title. I’d like to use the .htaccess file to fix this if possible in case other pages are getting lost.

Help

thanks,
Zeus

Offline

#2 2011-01-21 06:25:34

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,254
Website GitHub Mastodon Twitter

Re: How do I change .htaccess file so section/title goes to just /title?

Do you have /title as a permlink mode in the admin>preferences?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2011-01-21 07:21:32

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

Re: How do I change .htaccess file so section/title goes to just /title?

zeusdidit a écrit:

I’ve been crawled by google and some articles still point to section/title instead of just /title. I’d like to use the .htaccess file to fix this if possible in case other pages are getting lost.

This usually happens when you’ve been crawled when admin>preferences was set to /section/title, then changed to /title.
Here is the .htaccess directive to redirect old urls to new ones, assuming that url titles contain only lowercases and hyphens :

RewriteRule ^name-of-the-section\/([a-z-]+)$ /$1 [R=301,L]

Change name-of-the-section with the actual name. Of course you will have to write this line for each section.

Offline

Board footer

Powered by FluxBB