ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

URLs without trailing /

September 10, 2009 5:37pm

Subscribe [2]
  • #1 / Sep 10, 2009 5:37pm

    careerguy

    15 posts

    Is there a way to create a URL without the trailing “/”?

    Example, I would like to add to the following code to show a profile in a pop up with separate CSS:

    <a href="http://{url_title_path=directory/profile}">Show Profile</a>

    I would like the url produced to be:

    <a href="http://www.site.com/index.php/directory/profile/last_first?height=400&ampwidth=600">http://www.site.com/index.php/directory/profile/last_first?height=400&width=600"</a>

    I cannot find a way to remove the “/” before the ?. Thanks for any help.

  • #2 / Sep 10, 2009 8:45pm

    Kevin Evans

    222 posts

    hey I had this issue just this past week

    you add this to your .htaccess file for the exclude method for removing your index.php

    Options +FollowSymLinks
    
    RewriteEngine On
    RewriteBase /
    
    # Remove trailing slash
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_URI} ^(.+)/$
    RewriteRule ^(.*)/$ /$1 [L,R=301]
    
    RewriteCond $1 !^(css|scripts|js|inc|tools|office_tour|images|admin|swf|system|themes|pdf|west-virginia-truck-lawyers|oimages|ocss|oincludes|favicon\.ico|robots\.txt|test2005\.php|pennsylvania_attorneys_tpl\.html|index\.php) [NC]
    RewriteRule ^(.*)$ /index.php/$1 [L]
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases