Page 1 of 1

How-do-I-change-these-dashes-to-slashes-in-my-path?

Posted: Thu Apr 03, 2008 9:28 am
by chuck
Hello,
No matter how long I try, or what I do, I can not make sense of the way the CMSMS "friendly URL's" work.
It mostly works as I would hope. But there are a couple of issues that are driving me nuts.
OK Here's the data:
config.php:

Code: Select all

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

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

#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = true;

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

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

.htaccess:

Code: Select all

# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine On

#Rewrites page.shtml as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?location=$1 [QSA]

So here's the situation:
I have a menu like so:

* HOME - no children ( URI: / )
* RESOURCES (URI: /RESOURCES )
* how-to (URI: /RESOURCES/how-to )

note: the how-to has RESOURCES chosen as the parent, the how-to page has links to "how-to's" in it - this is where the problem begins.

the how-to page has a link to crontab.html. I created the crontab in the pages section of CMSMS, I told it to use RESOURCES
as it's parent, I told it NOT to display it in the menu. However, when I click on the crontab.html link, I am directed to:
/RESOURCES-crontab.html - NOT: /RESOURCES/crontab.html

Please help. This makes no sense to me. Why is there a hyphen and not a slash ( / )? Where do I fix this?

Thank you in advance.

Chuck

Re: How can I make a sensible, or SEO friendly CMSMS?

Posted: Thu Apr 03, 2008 11:00 am
by nuno
$config['internal_pretty_urls'] = false;
$config['query_var'] = 'location';

Re: How can I make a sensible, or SEO friendly CMSMS?

Posted: Thu Apr 03, 2008 11:41 am
by chuck
Hello, and thank you for your reply.

Unfortunately, your suggestion didn't work.

After making your suggested changes. I deleted the cache, and looked at the crontab page alias of it's
properties. But it shows RESOURCES-crontab - not RESOURCES/crontab.
If I change it (page alias) to RESOURCES/crontab. or /RESOURCES/crontab, CMSMS always
changes it back to RESOURCES-crontab.

Does anyone know what file this hyphen misfeature is located in? Or what setting I might be
overlooking is located?

Thank you again for your response.

Chuck

P.S. Forgot to mention; this is version 1.24


Re: How can I make a sensible, or SEO friendly CMSMS?

Posted: Thu Apr 03, 2008 11:45 am
by nuno
Show me all your  .htaccess

Options +FollowSymLinks
RewriteEngine on

#RewriteBase /
RewriteBase /cms/


# 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
RewriteCond %{REQUEST_FILENAME} !-d

#default
#RewriteRule ^(.+)$ index.php?page=$1 [QSA]

RewriteRule ^(.+)$ index.php?location=$1 [QSA]

Re: How can I make a sensible, or SEO friendly CMSMS?

Posted: Thu Apr 03, 2008 12:13 pm
by chuck
Hello, and thank you for your reply.
Show me all your  .htaccess
I already did.

Here it is again:

Code: Select all

#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off

# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine On

#Rewrites page.shtml as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?location=$1 [QSA]
This *should* already produce the desired results. But CMSMS is interfering with it.
The problem is that CMSMS is converting the desired slash ( / ) into a hyphen ( - ).
I already turned off the Internal "pretty URL" stuff, as suggested, so that CMSMS would
stop breaking the URI's. But I guess I need to fix something in one of the CMSMS function
files somewhere. If I only knew which file that misfeature was located in.

Oh. Yes, I have AllowOverride All set in the Apache config, and mod_rewrite
does work. CMSMS is located in document root. So all files begin at the top of the domain
name - http://www.domain.tld/
In other words; CMSMS works out of the root directory, not a subdir.

Thanks again for your reply.

Chuck


Re: How can I make a sensible, or SEO friendly CMSMS?

Posted: Thu Apr 03, 2008 12:15 pm
by nuno
Options +FollowSymLinks
RewriteEngine on
RewriteBase /


# 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
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.+)$ index.php?location=$1 [QSA]

Re: How can I make a sensible, or SEO friendly CMSMS?

Posted: Thu Apr 03, 2008 12:34 pm
by chuck
Hello, and thank you for your continued help.

I'm afraid CMSMS will not honor mod_rewrite. :(

CMSMS insists upon changing a slash ( / ) into a hyphen/dash ( - ).

So RESOURCES/crontab is automatically converted into RESOURCES-crontab even when
following your advice. Will someone please tell me which file CMSMS put this misfeature
in, so I can remove/change it to honor a normal hierarchy in page layout?

Thank you again for your continued help.

Chuck