Clean Hierachical URL's
Re: Clean Hierachical URL's
So this will work for all relative paths in a page and absolute paths won't be affected at all, right?
And it's XHTML-compliant. w00t!
And it's XHTML-compliant. w00t!
Re: Clean Hierachical URL's
Thanks Ryno for the explanation, if I'd been concentrating on this a bit more, rather than my washing machine, or rather my 'non-washing - oo I won't let you get your washing out' washing machine, then perhaps I would have understood Ted's perfectly reasonable explanation. Thanks - both of you. Just in case anyone else missed the idea, just put {metadata} in the section of your template. When the page is created it has a
in the header. (Note the actual path will vary.)
I've been having a play and pretty much everything seems funky, even ImageManager works now. (It's a pity it doesn't use the friendly url's like the rest of the site - but it works!) Yes iNSiPiD, it does validate, at least to XHTML Strict 1.0.
There are is only one small and one slightly bigger problem that I can see at present:
1. If, like me, you use something like this in your footer:
Then it will no longer work. You will get something like:
as the link, which will jump you back to your home page. I'm open to suggestions on this one, but it could be a case for a 'top' option in CMS_SelfLink jumping to the contents div? Any other ideas?
This may well apply to other bookmarks? SEE BELOW
2. PiSearch no longer works, you get blank links. Whilst I appreciate this is not 'our' code, we do need a search engine and this worked. I've had a look at the code
and can't see an obvious way of fixing this. Does anybody have any other ideas? SEE BELOW!
I've got to say this is all a very cool for CMS. I'm excited...When Ted gets the 0.13 betas up. I'll put it up on our test site so people can see how funky it really is. I've not tried the FCK internal link thing yet as it is not in my version. Also I haven't tried any other add-ins like 'news' because I don't use them, but am willing to put them on the test site if people think it will help?
UPDATE: 0.13BETA 1 is up on our test site. Includes freindly url's for piSearch (updated verson), updated cms_selflink for internal links, (Look at footer links)
http://www.cms.shoesforindustry.net
Russ
P.S. That's another big pat on the back Ted, anymore and you'll be badly bruised - but what a way to go...
Code: Select all
<base href="http://localhost/cms/" />
I've been having a play and pretty much everything seems funky, even ImageManager works now. (It's a pity it doesn't use the friendly url's like the rest of the site - but it works!) Yes iNSiPiD, it does validate, at least to XHTML Strict 1.0.
There are is only one small and one slightly bigger problem that I can see at present:
1. If, like me, you use something like this in your footer:
Code: Select all
<a title="Jump to Top" href="#content"> Top </a>
Code: Select all
http://localhost/cms/#content
This may well apply to other bookmarks? SEE BELOW
2. PiSearch no longer works, you get blank links. Whilst I appreciate this is not 'our' code, we do need a search engine and this worked. I've had a look at the code

I've got to say this is all a very cool for CMS. I'm excited...When Ted gets the 0.13 betas up. I'll put it up on our test site so people can see how funky it really is. I've not tried the FCK internal link thing yet as it is not in my version. Also I haven't tried any other add-ins like 'news' because I don't use them, but am willing to put them on the test site if people think it will help?
UPDATE: 0.13BETA 1 is up on our test site. Includes freindly url's for piSearch (updated verson), updated cms_selflink for internal links, (Look at footer links)
http://www.cms.shoesforindustry.net
Russ
P.S. That's another big pat on the back Ted, anymore and you'll be badly bruised - but what a way to go...
Last edited by Russ on Wed Apr 26, 2006 7:19 am, edited 1 time in total.
Re: Clean Hierachical URL's
The addition of this feature has made it certain that this is the CMS for me.
I can confirm that with a config.php of:
an .htaccess file containing:
and making sure that Apache will take notice of your .htaccess file, in my VirtualHost container I added:
It all works fine, this was on an svn version of the codebase "0.13-beta1"
Guys, I've got to say that as a web developer looking for something:
Thanks++, I hope to be able to contribute something back in the near future.
I can confirm that with a config.php of:
Code: Select all
$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;
Code: Select all
RewriteEngine On
Options FollowSymLinks
# set this to be an absolute path from your webservers document root
# if you've installed CMS into /foo then set this to /foo
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Code: Select all
<VirtualHost xxx.xxx.xxx.xxx>
..
<Directory /path/to/doc/root/>
AllowOverride All
</Directory>
...
</VirtualHost>
Guys, I've got to say that as a web developer looking for something:
- that Just Works
- is easy to skin
- where I don't need/want to read the manual
- has standards compliant innards
- has a healthy community
- where I could point a client at the admin interface from an (almost) vanilla install
Thanks++, I hope to be able to contribute something back in the near future.
Last edited by Bealers on Sat Apr 22, 2006 8:24 pm, edited 1 time in total.
- Elijah Lofgren
- Power Poster
- Posts: 811
- Joined: Mon Apr 24, 2006 1:01 am
- Location: Deatsville, AL
Re: Clean Hierachical URL's
My sentiments exactly!Bealers wrote: Guys, I've got to say that as a web developer looking for something:...CMSms ticks all the boxes.
- that Just Works
- is easy to skin
- where I don't need/want to read the manual
- has standards compliant innards
- has a healthy community
- where I could point a client at the admin interface from an (almost) vanilla install
Thanks++, I hope to be able to contribute something back in the near future.

Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 

Re: Clean Hierachical URL's
If I use this, requests for the root url made without the trailing slash fails. For example, a request for http://www.example.com/cms results in a 404 but http://www.example.com/cms/ (including the trailing slash) works. Do you have any idea what causes this?Bealers wrote:Code: Select all
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f [NC] RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Re: Clean Hierachical URL's
I can't seem to use the generic regex (.+) either and find the following two rules to be necessary for the rewrite. Note the forward slash in the first rule. A question mark in front of the forward slash also works as an 'if exists' and may be required by some servers.
RewriteRule ^([a-zA-Z0-9-]+)/$ /$1 [R]
RewriteRule ^([a-zA-Z0-9-]+)$ /index.php?page=$1 [NC]
You could also try:
RewriteRule ^(.+)/$ /$1 [R]
RewriteRule ^(.+)$ /index.php?page=$1 [NC]
RewriteRule ^([a-zA-Z0-9-]+)/$ /$1 [R]
RewriteRule ^([a-zA-Z0-9-]+)$ /index.php?page=$1 [NC]
You could also try:
RewriteRule ^(.+)/$ /$1 [R]
RewriteRule ^(.+)$ /index.php?page=$1 [NC]
Re: Clean Hierachical URL's
Alas, I get the same result using your suggestions. A request for http://example.com/cmsms results in a 404 error trying to get the url http://example.com/cmsms/?page=/var/www/pub/cmsmsiNSiPiD wrote: I can't seem to use the generic regex (.+) either and find the following two rules to be necessary for the rewrite.
Re: Clean Hierachical URL's
OK, what seems to do the trick, in my case anyway, is this:
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
Re: Clean Hierachical URL's
Mmmmm.... the sheer 'black magic art' of Mod Rewrite ;-*
Re: Clean Hierachical URL's
Tell me about it. The simplest rewrites using stock standard examples from Apache's website invariably require a tweak somwehere. Such is the sheer beauty of the http.conf file.
- Elijah Lofgren
- Power Poster
- Posts: 811
- Joined: Mon Apr 24, 2006 1:01 am
- Location: Deatsville, AL
Re: Clean Hierachical URL's
I wanted the following:
Here's what works for me:
In config.php
In .htaccess
Hope this helps someone.
- URLs in the form of: http://cms.localhost/navigation_menus/navtop/
- Anything requests missing the trailing slash to be redirected to have a trailing slash
Here's what works for me:
In config.php
Code: Select all
#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'] = '/';
Code: Select all
php_flag magic_quotes_gpc Off
php_flag register_globals Off
php_flag session.use_trans_sid Off
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/
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. 

Re: Clean Hierachical URL's
Using a trailing slash for the file extension paramter in config.php was a very clever piece of work.
Ted, is this an acceptable usage or is it likely to break something down the track?
Ted, is this an acceptable usage or is it likely to break something down the track?
Re: Clean Hierachical URL's
I don't see it being an issue. It's rather slick, actually. The url parsing code strips off any trailing slashes, so CMSMS should just ignore it.
Re: Clean Hierachical URL's
Hey Elijah,
Just tried your .htaccess settings and they work great for me.
Only problem is when I try to access /admin or admin/ I get a 404 error? Try http://www.seventhvision.com.au/cms/admin
Is this something I'm doing wrong is is this just a result of getting prety urls to work and I can just work around it?
Ryno
Just tried your .htaccess settings and they work great for me.
Only problem is when I try to access /admin or admin/ I get a 404 error? Try http://www.seventhvision.com.au/cms/admin
Is this something I'm doing wrong is is this just a result of getting prety urls to work and I can just work around it?
Ryno
Re: Clean Hierachical URL's
The rewrites above only account for existant files, not directories.
You need to create a rule for each directory you'd like access to. This also has the side affect of disallowing entry to folder views which, in most cases, is a good thing.
Just throw this into your htaccess file above the main rewrite rules.
RewriteRule ^/?admin/?$ /admin/index.php [R]
You need to create a rule for each directory you'd like access to. This also has the side affect of disallowing entry to folder views which, in most cases, is a good thing.
Just throw this into your htaccess file above the main rewrite rules.
RewriteRule ^/?admin/?$ /admin/index.php [R]