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: Help me with a rule Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
deepakrajr
Newbie
Newbie


Joined: 07 August 2007
Online Status: Offline
Posts: 14
Posted: 10 July 2008 at 8:12am | IP Logged Quote deepakrajr

HI,

I want to stop everything in the url after the .htm..

I get urls like www.abc.com/test.htm/
or
www.abc.com/test.htm/something/something

Please help me with this rule

Regards
deepak
Back to Top View deepakrajr's Profile Search for other posts by deepakrajr
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 335
Posted: 10 July 2008 at 8:33am | IP Logged Quote Vyacheslav

Hi deepakrajr!

Please try the following:
Code:
RewriteBase /
RewriteRule ^([^/]+)\.htm(?:.*)?$ $1.htm [NC,L,R=301]



__________________
Kind regards!
Vyacheslav.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
deepakrajr
Newbie
Newbie


Joined: 07 August 2007
Online Status: Offline
Posts: 14
Posted: 10 July 2008 at 9:27am | IP Logged Quote deepakrajr

HI Vyacheslav

Thanks for your reply.

i think i dint post it properly

if my url contains anything after .htm then i want to redirect to my custom 404 page. (accept # bookmarks of course)

eg

www.abc.com/hello.htm  -ok
www.abc.com/hello.htm/  -not ok (404)
www.abc.com/hello.htm/something  -not ok (404)

regards
deepak

Back to Top View deepakrajr's Profile Search for other posts by deepakrajr
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 335
Posted: 10 July 2008 at 10:38am | IP Logged Quote Vyacheslav

Please try the following:
Code:
RewriteBase /
RewriteCond %{REQUEST_URI} ^([^/]+)\.htm(.+)$ [NC]
RewriteRule .? error404.htm [NC,L,R=301]


__________________
Kind regards!
Vyacheslav.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 

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 cannot vote in polls in this forum