Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2010-06-06 11:53:47
- fhd
- Member
- Registered: 2009-11-01
- Posts: 13
Redirect default section to another section (both HTTP and Feeds)
Hi,
I’m using Textpattern for my blog (among others) which works quite well. However, I want to keep the option open to exand my website (i.e. adding other sections and a proper front page).
There is this default section which is currently set up just like the blog section, so both of the following urls lead to my blog:
http://example.org
http://example.org/blog
However, I’d like to have http://example.org redirect the user to http://example.org/blog (I want people to bookmark that).
I want to do the same with my RSS feeds, I want:
http://example.org/blog/rss
instead of:
http://example.org/rss
I was able to make the redirect work in browsers by putting the following in my default section:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta HTTP-EQUIV="REFRESH" content="0; url=/blog">
</head>
<body>
</body>
</html>
But feed readers would try to find a feed in this page’s header, ignoring the redirect. So it probably has to be a server side redirect. I tried the following default section while using the plugin aks_header, but no redirect happened:
<txp:aks_301 start="/|/blog/" /><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
I don’t have any idea how to tackle the rss url problem.
Any ideas how I can make this work?
Offline
#2 2010-06-06 19:37:47
- GugUser
- Member
- From: Quito (Ecuador)
- Registered: 2007-12-16
- Posts: 1,477
Re: Redirect default section to another section (both HTTP and Feeds)
In the .htaccess:
RedirectMatch ^/$ http://domain.com/blog [L]
Offline
#3 2010-06-06 19:57:03
- fhd
- Member
- Registered: 2009-11-01
- Posts: 13
Re: Redirect default section to another section (both HTTP and Feeds)
Thanks, that works!
However, my rss/atom URL is still not quite what I want. If I subscribe to my blog via a feedreader, the URL eventually becomes:
http://example.org/atom?section=blog
Can I make that read as follows?
http://example.org/blog/atom
Offline