Page 1 of 1

How to get rid of the last "/" in Pretty URL

Posted: Tue Apr 08, 2008 9:41 pm
by ironblaze94
Hi, how do i get rid of the last forward slash "/" in my pretty url so instead of being shown as

http://site.com/link/link/

it is shown as

http://site.com/link/link

Thank You  ;D

Re: How to get rid of the last "/" in Pretty URL

Posted: Wed Apr 09, 2008 7:20 pm
by Pierre M.
Hello,
ironblaze94 wrote: Hi, how do i get rid of the last forward slash "/" in my pretty url
Short answer : don't append it. Use an rewriting scheme that fits your needs. (my pretty URLs are .html postfixed)

Some information about trailing slashes mess (in life and in the doc) :
http://forum.cmsmadesimple.org/index.ph ... l#msg64195

Have you tried the official provided .htaccess sample ?
See also http://wiki.cmsmadesimple.org/index.php ... l_Settings about site.net/parent/child

Pierre M.

Re: How to get rid of the last "/" in Pretty URL

Posted: Thu Apr 10, 2008 12:40 pm
by ironblaze94
Hi Pierre

I did use the mod_rewrite straight out of the box, would you like me to post my .htaccess file?

I notice that the code given on this page http://wiki.cmsmadesimple.org/index.php ... retty_URLs for no file extention says the code will produce links similar to www.example.com/page1/page11/ which is what i get but i would like to know how to get rid of the last "/"

The CMSMS site doesn't have the last "/"

Re: How to get rid of the last "/" in Pretty URL

Posted: Thu Apr 10, 2008 12:42 pm
by ironblaze94
ok here is the .htaccess file

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

# Make sure you have Options FollowSymLinks
# and Allow on
RewriteEngine On

Options +FollowSymLinks
RewriteEngine on
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 [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]

Re: How to get rid of the last "/" in Pretty URL

Posted: Mon Apr 14, 2008 2:05 pm
by Pierre M.
Pierre M. wrote:
ironblaze94 wrote: Hi, how do i get rid of the last forward slash "/" in my pretty url
Short answer : don't append it. Use an rewriting scheme that fits your needs. (my pretty URLs are .html postfixed)
ironblaze94 wrote: # 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
Pierre M. wrote: Have you tried the official provided .htaccess sample ?
See also http://wiki.cmsmadesimple.org/index.php ... l_Settings about site.net/parent/child
Don't append the trailing slash you don't want. Use the official provided stuff that works.

Pierre M.