Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-04-2011, 05:42 PM   PM User | #1
wrayimmediate
New to the CF scene

 
Join Date: Nov 2011
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
wrayimmediate is an unknown quantity at this point
force trailing slash

I'd like to force a trailing slash to all of my web pages. Here's my .htaccess - I already implemented something to remove .php - I found a solution to remove .php and force a trailing slash in the past, but silly me, I deleted the .htaccess and now every google result I read doesn't work for me. Please help

Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteBase /
wrayimmediate is offline   Reply With Quote
Old 12-06-2011, 12:41 PM   PM User | #2
techlib
New to the CF scene

 
Join Date: May 2011
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
techlib is an unknown quantity at this point
Try this
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !index.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ $1/ [L,R=301]
techlib is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:39 AM.


Advertisement
Log in to turn off these ads.