Page 1 of 1
Friendly urls
Posted: Fri Jan 29, 2010 6:05 pm
by DonnaNJ
We are using friendly urls on this site
http://www.omegawomenscenter.com/index.php/insurance
and it all seems to be working
However client doesn't like the index.php inbetween - he read somewhere that this is not good for the search engines and doesn't want it.
He wants just /pagename - like we see on many other sites.
Is there a way to fix this ? Should I just put a redirect for each page into the .htaccess or something ?
Or is there another way to reconfigure this a config file ? OR
Thanks
DonnaNJ
Re: Friendly urls
Posted: Fri Jan 29, 2010 6:23 pm
by Rolf
Hi DonnaNJ
If this website is on a Windows server, you have no other choice...
Is the site on a linux server, you can change this line in the config.php
Code: Select all
$config['url_rewriting'] = 'internal';
to
Code: Select all
$config['url_rewriting'] = 'mod_rewrite';
Regards, Rolf
Re: Friendly urls
Posted: Fri Jan 29, 2010 8:14 pm
by DonnaNJ
OK tried that- on hover the url looks right -but clicking gives a page-not-found
So I added the following to the .htaccess (found in another post)
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# except for form POSTS
# RewriteCond %{REQUEST_URI} !/$
# RewriteCond %{REQUEST_URI} !\.
# RewriteCond %{REQUEST_METHOD} !POST$
# 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 ^(.+).htm$ index.php?page=$1 [QSA]
Still-page-not-found error.
Site is live so I had to go back to pretty urls.
DonnaNJ
Re: Friendly urls
Posted: Fri Jan 29, 2010 9:18 pm
by Rolf
Hi DonnaNJ
Your test shows that you are on a Windows server...
Windows doesn't do anything with the .htaccess file, thats why you get 404 errors.
You need to use Internal to get 'pretty' url.
And as far as I know this means you always get index.php in the url.
Regards, Rolf
Re: Friendly urls
Posted: Sat Jan 30, 2010 12:16 am
by Nullig
In your config.php file did you have the following set:
$config['page_extension'] = '.htm';
Nullig
Re: Friendly urls
Posted: Sat Jan 30, 2010 12:36 am
by Wishbone
Rolf wrote:
Your test shows that you are on a Windows server...
Windows doesn't do anything with the .htaccess file, thats why you get 404 errors.
If the Windows server is running Apache, it will read .htaccess files.
Re: Friendly urls Windows server
Posted: Mon Mar 22, 2010 11:46 am
by compufairy
I had to install CMSMS on a Windows server. The hoster had a nice description (and the ONLY referral to CMS Made Simple in the FAQ) how to active pretty URL in CMS Made Simple on their server. I give it to you here, maybe this works for you too...
Change "URL Settings" in config as described below.
#------------
#URL Settings
#------------
#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'] = '/';
#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'] = false;
#If using none of the above options, what should we be using for the query string
#variable? (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
Then make a file in the www root called "httpd.ini". In this file you write:
[ISAPI_Rewrite]
RewriteRule /([^/]+)/ /index.php?page=$1 [I,L]
RewriteCond Host: ^uwdomein.nl
RewriteRule (.*) http://www.uwdomein.nl$1 [I,RP]
Hope this works for you. If it does, please put [SOLVED] in front of topic.
Regards,
Anne-Mieke
Re: Friendly urls
Posted: Thu Mar 25, 2010 3:46 am
by Dr.CSS
That looks like a very old config.php, mine look like this...
#What type of URL rewriting should we be using for pretty URLs? Valid options are:
#'none', 'internal', and 'mod_rewrite'. 'internal' will not work with IIS some CGI
#configurations. 'mod_rewrite' requires proper apache configuration, a valid
#.htaccess file and most likely {metadata} in your page templates. For more
#information, see:
#
http://wiki.cmsmadesimple.org/index.php ... ty_URL.27s
$config['url_rewriting'] = 'mod_rewrite';
#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '.html';
#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy? (ex. htt***.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;
#If using none of the above options, what should we be using for the query string
#variable? (ex. htt***.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';
Note: *** added to not make links...
