Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [SOLVED] 301s
That looks very cool!!! I’ll report back.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] 301s
Just to report that Oleg’s suggestion worked wonderfully!!!
Sample url: https://www.neme.org/82/why-have-there-been-no-great-net-artists
Just in case anyone may need this feature here is the code in github and the htaccess which still needs a lot of work.
Thanks so much to all for your advice.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: [SOLVED] 301s
colak wrote #328679:
Sample url: https://www.neme.org/82/why-have-there-been-no-great-net-artists
If the problem is to redirect /id/title
URLs (that you don’t use any more) to /texts/title
, you should certainly be able to automate it (untested):
RedirectMatch 301 /(\d+)/([\w\-]+)$ /tests/$2?redirected=1
Offline
Re: [SOLVED] 301s
You could even handle it in error_404
(or error_default
):
<txp:evaluate query='<txp:page_url type="0" />=2 and <txp:page_url type="1" escape="integer" />>0'>
Please update your <txp:permlink id='<txp:page_url type="1" />'>bookmark</txp:permlink>.
</txp:evaluate>
Offline
Re: [SOLVED] 301s
etc wrote #328682:
If the problem is to redirect
/id/title
URLs (that you don’t use any more) to/texts/title
, you should certainly be able to automate it (untested):
RedirectMatch 301 /(\d+)/([\w\-]+)$ /tests/$2?redirected=1...
That actually does the job! and saves a lot of htaccess space.
etc wrote #328688:
You could even handle it in
error_404
(orerror_default
):
<txp:evaluate query='<txp:page_url type="0" />=2 and <txp:page_url type="1" escape="integer" />>0'>...
I was actually initially thinking of that but it is either directing them to the right page or having an intermediate one. Opted to save them a click:)
Thanks so much for your help. I think it is now solved.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline