This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Rewrite with Mapfile need extra parameter Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
gpcsystems
Newbie
Newbie


Joined: 08 December 2008
Location: Netherlands
Online Status: Offline
Posts: 11
Posted: 29 December 2009 at 1:56pm | IP Logged Quote gpcsystems

I have succesfully implemented the mapfile solutions several times in my self made CMS. I use a mapfile to rewrite all paramenters in the querystring.

I use in .htaccess

RewriteEngine on

RewriteMap mapfile txt:images/mapfile.txt

RewriteCond %{REQUEST_URI} ^/(?:images|cms) [NC]
RewriteRule .? - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.asp?${mapfile:$1} [NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+/[^/]+)/?$ index.asp?${mapfile:$1} [NC,L]

What i would like to do is to optionally add an extra parameter like this:

http://www.aannemersmarkt.nl/uw-bedrijf/cid=1
or
http://www.aannemersmarkt.nl/uw-bedrijf/&cid=1

The part cid=1 should be added behind the rewrite. Is this possible?

Back to Top View gpcsystems's Profile Search for other posts by gpcsystems Visit gpcsystems's Homepage
 
Vyacheslav
Admin Group
Admin Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 1542
Posted: 30 December 2009 at 7:11am | IP Logged Quote Vyacheslav

Hello,
Yes, it should work. I suggest you to use QSA flag in those rewrite rules.

__________________
Slavik Shynkarenko,
Helicon Tech.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
gpcsystems
Newbie
Newbie


Joined: 08 December 2008
Location: Netherlands
Online Status: Offline
Posts: 11
Posted: 30 December 2009 at 7:58am | IP Logged Quote gpcsystems

Like this?

RewriteEngine on

RewriteMap mapfile txt:images/mapfile.txt

RewriteCond %{REQUEST_URI} ^/(?:images|cms) [NC]
RewriteRule .? - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.asp?${mapfile:$1} [NC,L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+/[^/]+)/?$ index.asp?${mapfile:$1} [NC,L,QSA]

And should i use /?cid=1 or /&cid=1?

Back to Top View gpcsystems's Profile Search for other posts by gpcsystems Visit gpcsystems's Homepage
 
gpcsystems
Newbie
Newbie


Joined: 08 December 2008
Location: Netherlands
Online Status: Offline
Posts: 11
Posted: 30 December 2009 at 12:52pm | IP Logged Quote gpcsystems

Never mind, thanks for the advise, it was indead adding the QSA flag. This is what i was looking for!
Back to Top View gpcsystems's Profile Search for other posts by gpcsystems Visit gpcsystems'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