Page 1 of 1

Getting Clean URLs for News

Posted: Thu Aug 31, 2006 8:19 pm
by Ian Gordon
Now, I have just solved the problem that some people might have with getting rid of the "index.php/" in the URL for their news.

The steps are as follows:

1. Follow all the steps outlined here: http://wiki.cmsmadesimple.org/index.php ... retty_URLs

2. Go to "Global Settings" hit, "Clear Cache"

3. Go into config.php and edit your "url settings" to look like this:

Code: Select all

#------------
#URL Settings
#------------

#Show mod_rewrite URLs in the menu?
$config['assume_mod_rewrite'] = true;

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '/';

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false; <--- MOST IMPORTANT FOR CLEAN NEWS URLS!!!!

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
4. Go back to "Global Settings" click "Clear Cache" again

Congratulations! You now have "domain.com/news/1/15" as a URL.

Re: Getting Clean URLs for News

Posted: Mon Mar 05, 2007 6:23 pm
by mrk
Hey i have made these changes but it does not seem to effect the url or how the news does not show the details when you click the more link or the title link. this is after i clear cache before and after making the changes.

Re: Getting Clean URLs for News

Posted: Mon Mar 12, 2007 4:26 pm
by Elijah Lofgren
mrk wrote: Hey i have made these changes but it does not seem to effect the url or how the news does not show the details when you click the more link or the title link. this is after i clear cache before and after making the changes.
That's very strange. I'm not what's wrong.

There are other ways to get even nicer news URLs:

For URLs like: Gives URLS like /News/Category/Post-Title-22/
See:
http://forum.cmsmadesimple.org/index.ph ... l#msg51381
then follow:
http://forum.cmsmadesimple.org/index.ph ... l#msg51392

If you wouldn't mind using the Calendar module instead of the News module (like I plan to do):
For URLs like:
URLs like /2007/03/03/13-Post-Title/
see here: http://forum.cmsmadesimple.org/index.ph ... 487.0.html

Hope this helps,

Elijah