Help: Pretty URLs with multiple page extensions
Posted: Thu Aug 18, 2011 5:45 pm
I'm trying to figure out how to specify a page extension for specific pages which differs from the extension set in config.php. I'm migrating a site to CMSMS on which the 6 main pages have a trailing slash (http://www.foo.com/bar/) and all other pages (~300) are (http://www.foo.com/.../bar.html). Those six main URLs get lots of traffic and perform well in search listings, so I don't want to 301 redirect the URLs. I need to get CMSMS to generate the right URLs for those 6 pages.
My config settings are:
Here's where I'm at:
First off, '.html' isn't a valid string the URL field--so the URL field is no help. Second, mod_rewrite rules in .htaccess (RewriteRules rather than 301s) redirect just fine, but the links generated by {cms_selflink href="foo"} smarty tags point to the wrong (.../foo.html) URLs. For example:
The above will lead the visitor to the right URL, but only after clicking on one of the hundreds of links on the site which point to http://www.foo.com/bar.html (=wrong). No good. Also, going forward, the WSYIWYG will only generate the wrong URL when links to the main pages are posted here and there (in a News post, for instance).
You can see the site at weathergard(dot)org. The pages I'm referring to are the middle six links in the main menu, plus the 'News & Blog' link in the second column of the footer.
Thanks in advance.
Final note: I'm aware that there was a topic posted about this, but it was marked solved for no reason--no solution was posted, and there were no replies. I can't find any other posts on this topic. See: http://forum.cmsmadesimple.org/viewtopi ... =6&t=54571
My config settings are:
Code: Select all
$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '.html';
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';
First off, '.html' isn't a valid string the URL field--so the URL field is no help. Second, mod_rewrite rules in .htaccess (RewriteRules rather than 301s) redirect just fine, but the links generated by {cms_selflink href="foo"} smarty tags point to the wrong (.../foo.html) URLs. For example:
Code: Select all
RewriteRule ^bar.html$ http://www.foo.com/bar/ [NC,R=301,L]
You can see the site at weathergard(dot)org. The pages I'm referring to are the middle six links in the main menu, plus the 'News & Blog' link in the second column of the footer.
Thanks in advance.
Final note: I'm aware that there was a topic posted about this, but it was marked solved for no reason--no solution was posted, and there were no replies. I can't find any other posts on this topic. See: http://forum.cmsmadesimple.org/viewtopi ... =6&t=54571