Page 1 of 3

URLs - best practice?

Posted: Wed Jun 17, 2009 9:11 pm
by jezatron
Hi all.

I'm new to this. More of a designer, but recently learned how to make templates for CMSMS and found it really easy.

Ok so now I'm attempting to do a site for a client, using the latest version.


I really want the urls to be as much like...
clientsite.com/section/item
...as possible... but trying to research on this site and forum, and indeed google - I just seem to get lots of people posting desperate threads on here saying they have tried to set up pretty urls on their CMSMS and it hasn't worked.

So that I can avoid making the same mistakes as others, and then pestering everyone in a panic to help me find a solution... can people please advise me the best way to achieve such url structure?

Thanks in advance for any advice

Re: URLs - best practice?

Posted: Thu Jun 18, 2009 6:35 am
by alby
jezatron wrote: So that I can avoid making the same mistakes as others, and then pestering everyone in a panic to help me find a solution... can people please advise me the best way to achieve such url structure?
http://wiki.cmsmadesimple.org/index.php ... l_Settings

Alby

Re: URLs - best practice?

Posted: Thu Jun 18, 2009 8:11 pm
by jezatron
Hi thanks for the reply.

Yes I ended up trying that checklist, but like so many others I have gone through it with no joy. Bit lost as to how to get this to work now really to be honest?

Re: URLs - best practice?

Posted: Fri Jun 19, 2009 3:19 am
by viebig
There is no secret, if you follow the guidelines Alby sent you.

You´ll need:
  • Linux server
  • Apache with mod_rewrite (most of hosting companies)
just follow the guidelines.

Regards

G

Re: URLs - best practice?

Posted: Fri Jun 19, 2009 9:11 pm
by jezatron
yeah the worrying thing is i do have that spec for hosting, followed the instructions and no joy.

im wondering if ive mis interpreted the config / htaccess edits. i will post what i have and see if thats it.

Re: URLs - best practice?

Posted: Sat Jun 20, 2009 4:03 am
by viebig
please tell us more... paste system information here your .htaccess on the root folder too.

Re: URLs - best practice?

Posted: Sat Jun 20, 2009 8:49 pm
by jezatron
Server
LINUX (Redhat Enterprise v3.0 with Apache v1.3)
'You can present friendlier, easier to remember, search engine friendly URLs to your website visitors by using mod_rewrite on our shared Linux servers.'

htaccess
Right I just got rid of the old to try again.

eg1
Will just try and do exact minimum they say in linked page... the edit at bottom

///////////////////////


# Attempt to override some php settings, these settings may be helpful on some hosts if your
# default configuration does not meet CMS's minimum requirements, and your host
# has given your account appropriate permissions
#php_value upload_max_filesize "10M"
#php_value session_save_path "tmp/cache"

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

# (this is important, so uncomment if your host permit)
#Options -Indexes
#ServerSignature Off
#
Options +FollowSymLinks
#

RewriteEngine on
#
#Sub-dir e.g: /cmsms
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?page=$1 [QSA]

# You can make page URLs reflect their location
# in the hierarchy by enabling the 'use_hierarchy' option:
$config['use_hierarchy'] = true;



///////////////////////

Result
When attempting to view anything on site...
"The server encountered an internal error or misconfiguration and was unable to complete your request."

Re: URLs - best practice?

Posted: Sat Jun 20, 2009 8:50 pm
by jezatron
If i remove the file it works again?

Re: URLs - best practice?

Posted: Sat Jun 20, 2009 8:54 pm
by alby
jezatron wrote: RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

# You can make page URLs reflect their location
# in the hierarchy by enabling the 'use_hierarchy' option:
$config['use_hierarchy'] = true;


Drop red text from .htaccess
this is in config.php

Alby

Re: URLs - best practice?

Posted: Sat Jun 20, 2009 10:43 pm
by viebig
do what Alby said..

there is a parsing problem on .htaccess

Re: URLs - best practice?

Posted: Sat Jun 20, 2009 11:47 pm
by jezatron
hi guys thanks you were quick hitting me back.

i took that out of .htaccess, uploaded it and it went back to the same error now 500 internal server  :'(

do you think it may be easier to take everything off, and start again? Im just trying to get this right before i bother with doing everything else on the site... save probs later.

thanks for trying to help.

Re: URLs - best practice?

Posted: Sun Jun 21, 2009 5:57 am
by viebig
probbaly.. also check if your host support mod_rewrite

Re: URLs - best practice?

Posted: Sun Jun 21, 2009 9:41 am
by jezatron
yeah i checked and they do support it. i think i will try this - i.e strip it off and start again. i was knackered the other night (hence the slightly grumpy fed up tone).

Re: URLs - best practice?

Posted: Sun Jun 21, 2009 10:44 am
by alby
jezatron wrote: i took that out of .htaccess, uploaded it and it went back to the same error now 500 internal server  :'(
However http error 500 fire always something in http error log, look to

Alby

Re: URLs - best practice?

Posted: Sun Jun 21, 2009 10:59 am
by jezatron
Yeah good point. in error log says this

"htdocs/.htaccess: Options not allowed here"