Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2011-09-27 09:32:07
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
Redirect broken links to Specific Textpattern Sections
I’ve just recently redesigned a website using Textpattern. Unfortunately when searching for the company Google remembers a lot of the old now broken links for the website. Anyone who tries clicking on them will get a 404 error.
Is there a way I can put a redirect in place to forward people to the new location of the page they are trying to view. For instance instead of http://www.example.com/contact.asp redirect them to http://www.example.com/contact
Alternatively is there a way to make Google forget the old links?
Last edited by Algaris (2011-09-27 09:34:04)
Offline
Re: Redirect broken links to Specific Textpattern Sections
Algaris wrote:
Is there a way I can put a redirect in place to forward people to the new location of the page they are trying to view.
You’re on Windoze, right? So no .htaccess?
As it happens I had exactly this requirement for a site last night and guess what; I’ve written a plugin to do exactly what you describe. It’s very rough proof-of-concept at the moment (requiring you to edit the code to add redirect rules to a table) but I’ve begun work on the admin interface to sexy it up a bit. What’s your timescales on this one? I could shove an advance copy your way if you don’t mind a bit of brick dust floating around.
I can advise on another way to approach it by writing some code in your error_default page to catch 404s and shove people elsewhere but it’ll probably end up being most of this new plugin’s code anyway.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#3 2011-09-27 09:51:33
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
Re: Redirect broken links to Specific Textpattern Sections
Well it’s not urgent as yet but my boss did ask me what could be done about it today after receiving feedback on the website. I could earn some brownie points if I fix it quickly without spending too much time on it.
Providing I don’t have to hack too much (PHP / JavaScript) code around and there’s an easy upgrade path when you release the full version I don’t mind things being a little rough around the edges.
Thankfully the schools main website is externally hosted on a Linux server, it’s only the calendar which had to be on Windows.
Offline
Re: Redirect broken links to Specific Textpattern Sections
You could try:
- plain Apache redirects (
Redirect /old_page.html http://www.mysite.com/new_page/
) in the .htaccess file. - arc_redirect
- aks_header
Offline
Re: Redirect broken links to Specific Textpattern Sections
maniqui wrote:
arc_redirect
This is the closest thing I could find to my propsed plugin so if you are in need of something now I heartily recommend this one.
Mine is basically the same approach; it only differs in that it will allow you to do a bit more. Namely wildcard matches, replacements and rule ordering. Also, it does not rely on a 404 being generated: you could redirect anything to anything else. Sort of a poor-man’s gbp_permanent_links mixed with arc_redirect and zem_redirect.
So, on reflection it sounds like for your case my solution would be overkill. Go with Andy’s plugin. You won’t regret it.
Last edited by Bloke (2011-09-27 12:48:01)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#6 2011-09-27 13:22:14
- Algaris
- Member
- From: England
- Registered: 2006-01-27
- Posts: 581
Re: Redirect broken links to Specific Textpattern Sections
Okay I’ll go with arc_redirect then. Thank you both for the advice.
Your plugin does sound very interesting Stef. Give me a nudge when it’s doen and I’ll take it for a spin (time permitting).
Offline