Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: trailing slash issue Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
BigMonty
Newbie
Newbie


Joined: 02 August 2008
Online Status: Offline
Posts: 7
Posted: 02 August 2008 at 2:57pm | IP Logged Quote BigMonty

Hi there,

Thanks for taking the time to look at this. I'm trying to implement a rule that ensures that I always have a trailing slash present. I found a rule on this site and it works when my other rule isnt being processed. My other rule basically creates a SEO friendly link, but if for whatever reason theres no slash at the end of it, the first rule doesnt add one on.

Below is my rules file, any help would be greatly appreciated!

## Force a trailing slash character on folders in the browsers adressbar

RewriteCond Host: (.*)
RewriteRule ^([^.?]+[^.?/])$ $1/ [R=301]

RewriteRule (.+)/([0-9]+)/ /directory/profiles.asp?id=$2 [I,L]

Back to Top View BigMonty's Profile Search for other posts by BigMonty
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4837
Posted: 04 August 2008 at 4:24am | IP Logged Quote Anton

Are you using ISAPI_Rewrite 2 or 3?

The syntax for v2 is as follows:

#Fix missing slash char on folders
RewriteCond Host: (.*)
RewriteRule ([^.?]+[^.?/]) http\://$1$2/ [I,R]
RewriteRule /.+/(\d+)/ /directory/profiles.asp?id=$1 [I,L]


__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
BigMonty
Newbie
Newbie


Joined: 02 August 2008
Online Status: Offline
Posts: 7
Posted: 05 August 2008 at 11:33am | IP Logged Quote BigMonty

Hi Anton,

 

I'm using v. 3 if that helps at all.

Back to Top View BigMonty's Profile Search for other posts by BigMonty
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4837
Posted: 06 August 2008 at 3:23am | IP Logged Quote Anton

Here's the config for v3:

RewriteBase /
RewriteRule ^([^.?]+[^.?/])$ $1/ [R,L]
RewriteRule ^.+/([0-9]+)/$ /directory/profiles.asp?id=$1 [NC,L]

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
BigMonty
Newbie
Newbie


Joined: 02 August 2008
Online Status: Offline
Posts: 7
Posted: 11 August 2008 at 6:31pm | IP Logged Quote BigMonty

many thanks, works perfectly :)
Back to Top View BigMonty's Profile Search for other posts by BigMonty
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You can vote in polls in this forum