Say I have example.com
set up with a PyroCMS installation, everything is working fine.
I've created a few posts on the blog and categorised them, so I end up with URLs like the following:
example.com/blog/category/foo
example.com/blog/category/bar
I'd like to access those categories with much shorter URLs, like the following:
example.com/foo
example.com/bar
I've tried the following (and several variations on it) in the .htaccess
but gotten nothing but 500 errors and infinite redirects. It's the standard file as per github that I'm working with, with my additions below:
<IfModule mod_php5.c>
RewriteRule ^(.*)$ index.php/$1 [L]
RewriteRule foo /blog/category/foo [L]
</IfModule>
If anyone knows how to do this it would be much appreciated :)
I'm sure this is possible and preferable at the .htaccess
level but I've settled for a PHP based approach for now. Specifically, adding some routes to the top of my system/cms/config/routes.php
:
$route['(foo)'] = 'blog/category/$1';
$route['(bar)'] = 'blog/category/$1';
I had a follow up question of how to get this to work with examples.com/
(i.e. the site root), this approach doesn't work for that though unfortunately.