URLs - best practice?

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.
jezatron
Forum Members
Forum Members
Posts: 63
Joined: Sun May 17, 2009 3:02 pm

URLs - best practice?

Post 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
alby

Re: URLs - best practice?

Post 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
jezatron
Forum Members
Forum Members
Posts: 63
Joined: Sun May 17, 2009 3:02 pm

Re: URLs - best practice?

Post 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?
viebig

Re: URLs - best practice?

Post 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
jezatron
Forum Members
Forum Members
Posts: 63
Joined: Sun May 17, 2009 3:02 pm

Re: URLs - best practice?

Post 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.
viebig

Re: URLs - best practice?

Post by viebig »

please tell us more... paste system information here your .htaccess on the root folder too.
jezatron
Forum Members
Forum Members
Posts: 63
Joined: Sun May 17, 2009 3:02 pm

Re: URLs - best practice?

Post 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."
jezatron
Forum Members
Forum Members
Posts: 63
Joined: Sun May 17, 2009 3:02 pm

Re: URLs - best practice?

Post by jezatron »

If i remove the file it works again?
alby

Re: URLs - best practice?

Post 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
viebig

Re: URLs - best practice?

Post by viebig »

do what Alby said..

there is a parsing problem on .htaccess
jezatron
Forum Members
Forum Members
Posts: 63
Joined: Sun May 17, 2009 3:02 pm

Re: URLs - best practice?

Post 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.
viebig

Re: URLs - best practice?

Post by viebig »

probbaly.. also check if your host support mod_rewrite
jezatron
Forum Members
Forum Members
Posts: 63
Joined: Sun May 17, 2009 3:02 pm

Re: URLs - best practice?

Post 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).
alby

Re: URLs - best practice?

Post 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
jezatron
Forum Members
Forum Members
Posts: 63
Joined: Sun May 17, 2009 3:02 pm

Re: URLs - best practice?

Post by jezatron »

Yeah good point. in error log says this

"htdocs/.htaccess: Options not allowed here"
Post Reply

Return to “CMSMS Core”