Clean urls for news (yes, I searched)

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
climberusa
Forum Members
Forum Members
Posts: 126
Joined: Sun Feb 26, 2006 7:10 pm

Clean urls for news (yes, I searched)

Post by climberusa »

I apologize if this topic is getting old. I've spent some time searching for the naswer but it eludes me thus far. What do I need to do to have clean urls in the news module? I have the latest version of cmsms and set the config.php file straight. I'm dying here.
Appreciate any help.
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm

Re: Clean urls for news (yes, I searched)

Post by Russ »

What are you getting for news?
Best you can probably get untill the 'callpage' stuff is added in the next release (hopefully) is:

http://localhost/cms/news/2/82/

Russ
climberusa
Forum Members
Forum Members
Posts: 126
Joined: Sun Feb 26, 2006 7:10 pm

Re: Clean urls for news (yes, I searched)

Post by climberusa »

That's what I want for now. I'm still getting this:

index.php?mact=News,cntnt01,detail,0&cntnt01articleid=11&cntnt01origid=15&cntnt01detailtemplate=features_detail.tpl&cntnt01returnid=48

Maybe a re-install?
climberusa
Forum Members
Forum Members
Posts: 126
Joined: Sun Feb 26, 2006 7:10 pm

Re: Clean urls for news (yes, I searched)

Post by climberusa »

Well, uninstalled the news module, cleared my cahce and re-installed it to no avail. Is there anything extra I'm supposed to do in my .htaccess file or config file? I'm getting clean urls everywhere else.
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm

Re: Clean urls for news (yes, I searched)

Post by Russ »

Actually to get what I have you need

I'm sure you have $config['internal_pretty_urls'] = false; Otherwise you get index.php/news.

and Mod-rewrite to true and then the mod rewrite stuff in your .htaccess.

Russ
climberusa
Forum Members
Forum Members
Posts: 126
Joined: Sun Feb 26, 2006 7:10 pm

Re: Clean urls for news (yes, I searched)

Post by climberusa »

Weird. I've changed my config.php file to try every combination to no avail. I stil get the crazy-long url for news. I'm using the .htaccess fil from the wiki. Any other ideas?
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm

Re: Clean urls for news (yes, I searched)

Post by Russ »

Post your .htaccess and config here (minus passwords) and we maybe able to figure it out?
What sort of server are you on?

I'm away for a few days, but I'm sure someone will be able to help.

Russ
climberusa
Forum Members
Forum Members
Posts: 126
Joined: Sun Feb 26, 2006 7:10 pm

Re: Clean urls for news (yes, I searched)

Post by climberusa »

I'm hosted on dreamhost so I'm not sure what version of apache they're running.

Here is my config.php file:

Code: Select all

#If app needs to coexist with other tables in the same db,
#put a prefix here.  e.g. "cms_"
$config['db_prefix'] = 'cms_';

#Use persistent connections?  They're generally faster, but not all hosts
#allow them.
$config['persistent_db_conn'] = false;

#Use ADODB Lite?  This should be true in almost all cases.  Note, slight
#tweaks might have to be made to date handling in a "regular" adodb
#install before it can be used.
$config['use_adodb_lite'] = true;

#-------------
#Path Settings
#-------------

#Document root as seen from the webserver.  No slash at the end
#e.g. http://blah.com
$config['root_url'] = 'http://www.example.com';

#Path to document root. This should be the directory this file is in.
#e.g. /var/www/localhost
$config['root_path'] = '/home/example.com';

#Name of the admin directory
$config['admin_dir'] = 'admin';

#Where do previews get stored temporarily?  It defaults to tmp/cache.
$config['previews_path'] = '/home/.quirk/example/tmp/cache';

#Where are uploaded files put?  This defaults to uploads.
$config['uploads_path'] = '/home/.quirk/example/uploads';

#Where is the url to this uploads directory?
$config['uploads_url'] = 'http://www.example.com/uploads';

#---------------
#Upload Settings
#---------------

#Maxium upload size (in bytes)?
$config['max_upload_size'] = 7000000;

#Permissions for uploaded files.  This only really needs changing if your
#host has a weird permissions scheme.
$config['default_upload_permission'] = '664';

#------------------
#Usability Settings
#------------------

#Allow smarty {php} tags?  These could be dangerous if you don't trust your users.
$config['use_smarty_php_tags'] = false;

#CMSMS Debug Mode?  Turn is on to get a better error when you
#see {nocache} errors.
$config['debug'] = false;

#Automatically assign alias based on page title?
$config['auto_alias_content'] = true;

#------------
#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'] = true;

#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';

#--------------
#Image Settings
#--------------

#Which program should be used for handling thumbnails in the image manager.
#See http://wiki.cmsmadesimple.org/index.php/User_Handbook/Admin_Panel/Content/Image_Manager for more
#info on what this all means
$config['image_manipulation_prog'] = 'GD';
$config['image_transform_lib_path'] = '/usr/bin/ImageMagick/';

#Default path and URL for uploaded images in the image manager
$config['image_uploads_path'] = '/home/.quirk/example.com/uploads/images';
$config['image_uploads_url'] = 'http://www.example.com/uploads/images'; 

#------------------------
#Locale/Encoding Settings
#------------------------

#Locale to use for various default date handling functions, etc.  Leaving
#this blank will use the server's default.  This might not be good if the
#site is hosted in a different country than it's intended audience.
$config['locale'] = '';

#In almost all cases, default_encoding should be empty (which defaults to utf-8)
#and admin_encoding should be utf-8.  If you'd like this to be different, change
#both.  Keep in mind, however, that the admin interface translations are all in
#utf-8, and will be converted on the fly to match the admin_encoding.  This
#could seriously slow down the admin interfaces for users.
$config['default_encoding'] = '';
$config['admin_encoding'] = 'utf-8';

#---------------------------------------------
#Use the old stylesheet logic?  It's much slower, but it works with older
#versions of CMSMS.  You'll also need this set to true if there is a module
#that uses a stylesheet callback.  Leave it as false instead you really
#need it.
$config['old_stylesheet'] = false;

# URL of the Admin Panel section of the User Handbook
$config['wiki_url'] = 'http://wiki.cmsmadesimple.org/index.php/User_Handbook/Admin_Panel';

#Not used anymore... kept around, just in case
$config['disable_htmlarea_translation'] = false;
$config['use_Indite'] = true;
?>
and my .htaccess file

Code: Select all

Options +FollowSymLinks
RewriteEngine on

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Appreciate your help.
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm

Re: Clean urls for news (yes, I searched)

Post by Russ »

Looks OK to  me apart from the
$config['internal_pretty_urls'] = true;
which should be set to false.

(I'm assuming you have the paths set right for you host?)

Not sure if it was you, but there was some weird stuff to do wth Dreamhost - not so long agon, forget the details but it was todo with the host you were on - where it was best to be on a 32bit host rather than a 64bit one. PHP problems I think with the 64bit one.

Are you allowed to set 'RewriteEngine on' ?

Hope this helps,
Russ
MikePearce

Re: Clean urls for news (yes, I searched)

Post by MikePearce »

I'm also having a similar problem, I can't get the mod_rewrite to work with the news module, everywhere else, it works fine!

Here is my htaccess:

Code: Select all

<Directory *****/****/***>
order allow,deny
allow from all
Options Indexes FollowSymLinks +Includes
RewriteEngine on

# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]

# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

AddType application/x-httpd-php .html .css
</Directory>
</VirtualHost>
and here is an extract from config.php:

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;

#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';
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm

Re: Clean urls for news (yes, I searched)

Post by Russ »

Sorry, i did not realise it was just News. i'm using an SVN version, so it might be prudent to have a look at what version of CMSMS and the news module you are using?

Russ
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: Clean urls for news (yes, I searched)

Post by Ted »

Can you do me a favor and change

$config['page_extension'] = '/';

to

$config['page_extension'] = '';

I think there might be an issue somewhere with handling that / at the end.
Post Reply

Return to “CMSMS Core”