sashtown / baseblog

—// This is a Kirby 2 project which is no longer maintained!
http://baseblog.sashtown.de/
Other
53 stars 14 forks source link

Category links redirect back to home page #3

Closed atomicbird closed 11 years ago

atomicbird commented 11 years ago

I installed Kirby following its instructions, and then added Baseblog by replacing Kirby's assets, content, and site directories with Baseblog's. I haven't made any other changes to the Kirby code.

If I click on one of the category links in Baseblog's sample content directory, I get redirected back to the site home page (HTTP 302 and a Location: header). For example:

curl -v http://localhost/blog/category:Tools
* About to connect() to localhost port 80 (#0)
*   Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET /blog/category:Tools HTTP/1.1
> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5
> Host: localhost
> Accept: */*
> 
< HTTP/1.1 302 Found
< Date: Wed, 13 Mar 2013 20:59:29 GMT
< Server: Apache/2.2.22 (Unix) DAV/2 PHP/5.3.15 with Suhosin-Patch mod_ssl/2.2.22 OpenSSL/0.9.8r
< X-Powered-By: PHP/5.3.15
< Location: http://localhost/
< Content-Length: 0
< Content-Type: text/html
< 
* Connection #0 to host localhost left intact
* Closing connection #0

This is with Baseblog commit 5616757 and Kirby commit a242815, both current as of today. I see that http://baseblog.sashtown.de doesn't have this problem-- maybe it's using an older version of Kirby?

atomicbird commented 11 years ago

Some experimenting shows that changing the home setting in site/config/config.php to something other than blog (e.g. docs) makes category links work, though of course it changes the site home page. (Maybe this is obvious to people with more Kirby experience...). I'm not sure why this is (apparently) not the case at http://baseblog.sashtown.de

sashtown commented 11 years ago

I'm working with a redirect in the .htaccess

RedirectMatch 301 ^/blog/(.*)$ /$1

to avoid those uncool blog/ - parts in the URLs of blog posts. This makes sense, when building a Kirby site with a blog on the home page. Unfortunately it doesn't work on local environments like XAMPP or MAMP. But it'll work fine on a production sever as you can see.

Another option (and surely the better one in case of local testing) is to drop the blog/ - parts within the category links of the blog (and search) templates. I'm gonna fix that asap.

sashtown commented 11 years ago

Done.

atomicbird commented 11 years ago

Thanks, that takes care of it.