Page 1 of 1

Help: Pretty URLs with multiple page extensions

Posted: Thu Aug 18, 2011 5:45 pm
by jlmcm
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:

Code: Select all

$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '.html';
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';
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:

Code: Select all

RewriteRule ^bar.html$ http://www.foo.com/bar/ [NC,R=301,L]
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

Re: Help: Pretty URLs with multiple page extensions

Posted: Thu Aug 18, 2011 6:17 pm
by opawaldburger
Read through the other post again, the guy found a workaround he posted on the top. But I don't know if it helps, since, as said, it's just a workaround.

If it doesn't help, I'm sorry, can't help you either. I'm really bad at server-stuff ;)

-opa

Re: Help: Pretty URLs with multiple page extensions

Posted: Thu Aug 18, 2011 6:30 pm
by jlmcm
First, I'm not sure how I missed that bit at the top of the post you're referring to.

Second, I don't believe the workaround will help me with the problem I've got, since I need to have the URLs preserved, and I therefore cannot add a '/foo/' to the URL and then rewrite the URLs containing it.

Re: Help: Pretty URLs with multiple page extensions

Posted: Thu Aug 18, 2011 7:13 pm
by opawaldburger
Thought so already... I'm sorry, I'm stuck here too.

Re: Help: Pretty URLs with multiple page extensions

Posted: Fri Aug 19, 2011 7:34 pm
by jlmcm
Any other thoughts ... anyone?