Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Common Questions
 Helicon Tech : Common Questions
Subject Topic: Rewrite rule help please Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Joth
Newbie
Newbie


Joined: 22 June 2010
Online Status: Offline
Posts: 1
Posted: 22 June 2010 at 4:45am | IP Logged Quote Joth

Hi I am trying to write a simple rule that will rewrite

www.mydomain.co.uk/testing/myVar as www.mydomain.co.uk/test.asp?fred=myVar

This version seems to work fine:

RewriteRule ^testing/([^/\.]+) test.asp?fred=$1 [NC,L]

but this one (with dollar marking end of string) does not:

RewriteRule ^testing/([^/\.]+)$ test.asp?fred=$1 [NC,L]

Why not, what am I doing wrong?

Many thanks in advance.


Back to Top View Joth's Profile Search for other posts by Joth
 
Guests
Guest
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -111
Posted: 23 June 2010 at 3:45am | IP Logged Quote Guests

Hello,

I'd suggest using the following:

Code:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^testing/([^/]+)$ /test.asp?fred=$1 [NC,L]


This will test if the file or folder exist physically and will rewrite it.

Regards
Andrew
Back to Top View Guests's Profile Search for other posts by Guests
 

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