Pretty URLs -- to .html or not?

General project discussion. NOT for help questions.
Post Reply
JohnR

Pretty URLs -- to .html or not?

Post by JohnR »

Hi, I think this is my first post here. [Edit: whoops! It's my second...] Let me just say that CMSMadeSimple is a lifesaver! Respect to the team that created it.

I was just wondering whether folks think that the .html suffix is better or not better. eg This:

  http://www.mysite.com/somepage.html

or:

  http://www.mysite.com/somepage

Which do you prefer (and why?)

(I am using 0.13, natch)
Last edited by JohnR on Mon May 22, 2006 2:39 am, edited 1 time in total.
Dj_Apx

Re: Pretty URLs -- to .html or not?

Post by Dj_Apx »

Hello,
virtual folders (like example.com/mypage/ ) are ok, but if you're going to make it a file (without the last slash) it's much better from a user perspective to put the .html if it's html  ;)

All the best,
Dj_Apx

P.S : there are specific websites for giving examples : example.org and example.com . i am pretty much sure that mysite.com exists so no need to advertise it  ;)
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

Re: Pretty URLs -- to .html or not?

Post by Russ »

I'm with Dj_Apx:

'example.com/somepage.html' or (preferably) 'example.com/somepage/' but not 'example.com/somepage'

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

Re: Pretty URLs -- to .html or not?

Post by climberusa »

if you do a mo-rewrite so your urls are www.mysite.com/example/ don't you have issues with image links or is that fixed in the latest release?
JohnR

Re: Pretty URLs -- to .html or not?

Post by JohnR »

Hi guys, thanks for the responses! I would certainly be happy to follow the suggestion of making it look likke directories and files, but I thought that the examples I gave were the only choices. I'll look at it again...!
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

Re: Pretty URLs -- to .html or not?

Post by Russ »

Hi climberusa, not sure what you mean, normal image paths are fine in 0.134 beta. If you mean ImageGallery, Ted was working on a fix or if you mean the popular Album - then there are fixes in the forum.

Hope this helps,
Russ
lemkepf
Forum Members
Forum Members
Posts: 163
Joined: Tue Oct 18, 2005 8:30 pm

Re: Pretty URLs -- to .html or not?

Post by lemkepf »

climberusa wrote: if you do a mo-rewrite so your urls are www.mysite.com/example/ don't you have issues with image links or is that fixed in the latest release?
You need to put the {metatag} in your template which put's a "Base" tag in your html. This basically says any "relative" image links are starting here... example:
If your at page /mycategory/nextcategory/mypage/ and your put the base tag in, your image that looks like this: images/image.gif
would really look like this: /images/image.gif  (or wherever your images are)

Cool huh? :)
Caspar

Re: Pretty URLs -- to .html or not?

Post by Caspar »

Hi,

I know this forum is not for help-questions, but since we're already talking...  ;)

I installed 0.13 with clean urls and sample content and get something like: http://www.mysite.com/index.php/home
Does anyone of you guys know how I get to: http://www.mysite.com/home or http://www.mysite.com/home/ ?

Or is it my configuration? In my config.php of 0.13 I left mod_rewrite = false, but I run another system on my server using the htaccess-thing, so mod_rewrite is actually on. Stupid?  ::)

Thanks so much,

Cas

P.S.: And just for the sake of asking: Has anyone tried to direct a domain to a parent-/child-page like http://www.mysite.com/home/ ? Could that be a way to set up a multi-site system with various domains leading to different parent-/child-pages in the tree?

Getting bold now, I know...  :P
Thanks, Cas
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

Re: Pretty URLs -- to .html or not?

Post by Russ »

You need to set, in your config.php

$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '/';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;

And then add the following stuff to your .htaccess file. Something like:

#Config for CMS
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]

Hope this helps,

Russ
Caspar

Re: Pretty URLs -- to .html or not?

Post by Caspar »

It does perfectly well!

Only the directing-a-domain part does not, but that's no problem for here.

Thank you, Russ. You've made a working man happy in the morning, be blessed!  :D
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

Re: Pretty URLs -- to .html or not?

Post by Russ »

cas, glad to help and be blessed so early on a Saturday morning ;-)

Russ
ced64k
Forum Members
Forum Members
Posts: 17
Joined: Mon May 15, 2006 9:09 am

Re: Pretty URLs -- to .html or not?

Post by ced64k »

It doesn't work for me  :-[

I have a 500 Internal Server Error with this htaccess, however mod_rewrite is activated on my hosting. Any idea ?

Thanks  :)
Russ
Power Poster
Power Poster
Posts: 813
Joined: Fri Nov 25, 2005 5:02 pm
Location: North West England

Re: Pretty URLs -- to .html or not?

Post by Russ »

Sounds like either you are not allowed to do these changes (some hosts don't allow it) or that you have something else in your .htaccess making it invalid? Can you post it here?

Russ
ced64k
Forum Members
Forum Members
Posts: 17
Joined: Mon May 15, 2006 9:09 am

Re: Pretty URLs -- to .html or not?

Post by ced64k »

Post Reply

Return to “General Discussion”