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 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Excluding page extension
Author
Message |
Samish
Newbie


Joined: 12 April 2006
Posts: 12
Posted: 15 September 2010 at 2:33pm

Hi all,

1/ Help on Rw rule please :

I need to have "shorcuts", eg. mydomain/car
(no, it's not my idea !!)

RewriteRule /([^/?_]+) /shortcuts.asp\?kw=$1 [I,L]

Obviously, this rule catch all, eg. /test.htm or /test.htm
Can't build rw rule excluding file extentions .asp .htm, .html .php

Can u help me please on this ?


2/ Pb on http headers status :

RewriteRule /myfoldername/([^/?.]+)\.html /find_equivalent.asp\?mod=idxcode&idxid=4&kw=$1 [I,L]

In this case :
([^/?.]+) = kw to find in database,
kw processed on find_equivalent.asp
find_equivalent.asp redirects in asp to the new page url.
The ASP Response.status in find_equivalent.asp is set to 301

eg. : /myfoldername/myname.html leads to /1326.html
1326 is the id in database, i grab in find_equivalent.asp

No prob with this but :


RewriteRule /myfoldername/([^/?.]+)\.html /find_equivalent.asp\?mod=idxcode&idxid=4&kw=$1 [I,L]
Http header analysis returns 302, not 301 => wrong status

RewriteRule /myfoldername/([^/?.]+)\.html /find_equivalent.asp\?mod=idxcode&idxid=4&kw=$1 [I,L,RP]
Http header analysis returns 301, wich is ok but Location is : /find_equivalent.asp, not
/1326.html => wrong location for search engines

Any idea ?

Thanx
Samish
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 16 September 2010 at 3:57am

1.
RewriteRule /(?!(?:admin|css|js|script|and|other|physical|folders))([^/.?_]+) /shortcuts.asp\?kw=$1 [I,L]

2.
"RewriteRule /myfoldername/([^/?.]+)\.html /find_equivalent.asp\?mod=idxcode&idxid=4&kw=$1 [I,L]
Http header analysis returns 302, not 301 => wrong status

RewriteRule /myfoldername/([^/?.]+)\.html /find_equivalent.asp\?mod=idxcode&idxid=4&kw=$1 [I,L,RP]
Http header analysis returns 301, wich is ok but Location is : /find_equivalent.asp, not
/1326.html => wrong location for search engines"

- can't think of a way to achieve this. How do you think it's possible? Making 301 redirect without changing the Location?

__________________
Regards,
Anton
Back to Top
 
Samish
Newbie


Joined: 12 April 2006
Posts: 12
Posted: 21 September 2010 at 5:46am

Hi,

1/ Thanks Anton for help on rule

2/ i might express my question into "wrong" words :
Not a question of changing the location path, but
a question of displaying the good path.

/find_equivalent.asp is the hub page which redirects to /1326.html

In my dream :
Http header code 301
Http header location path : /1326.html

Thx
Samish

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 21 September 2010 at 7:24am

Ok, I see. Let's try it like this then:

RewriteRule /find_equivalent\.asp\?mod=idxcode&idxid=4&kw=(\d+) http://www.domain.com/$1\.html [I,RP]
RewriteRule /(\d+)\.html /find_equivalent.asp\?mod=idxcode&idxid=4&kw=$1 [I,L]

__________________
Regards,
Anton
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
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