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: redirect only .aspx files
Author
Message |
Chimney72
Newbie


Joined: 21 January 2011
Posts: 5
Posted: 21 January 2011 at 6:14am

I'm develloping a website on IIS6 with mod_rewrite enabled in Isapi Rewrite 2. I'm having a problem redirecting anything but .aspx files.
I've got:
RewriteEngine On
RewriteRule (.*) info.php [I,L]

when i go to www.domain.com/test i get a 404. when i go to www.domain.com/test.aspx it shows the info.php.
I should say that there is asp.net installed as well as php. What am i doing wrong?   
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 21 January 2011 at 7:49am

"I'm having a problem redirecting anything but .aspx files."
For ISAPI_Rewrite2 it will be:

[ISAPI_Rewrite]
RewriteRule (?!.*\.aspx).* /info.php [I,L]

__________________
Regards,
Anton
Back to Top
 
Chimney72
Newbie


Joined: 21 January 2011
Posts: 5
Posted: 21 January 2011 at 8:06am

When i try that i still get a 404 on /test
On /test.aspx i get:
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /test.aspx

Just to make it clear. It is not possible to use RewriteEngine On even when the hosting company sais i can?
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 24 January 2011 at 3:26am

Could you clarify which version of ISAPI_Rewrite you are using - 2 or 3?
And also please outline how you need to process different types of requests (e.g. /test, /test.aspx, /test.php)?

__________________
Regards,
Anton
Back to Top
 
Chimney72
Newbie


Joined: 21 January 2011
Posts: 5
Posted: 24 January 2011 at 4:34am

I'm using ISAPI_Rewrite 2. Is hould be able to use .htaccess, which seems to be working, except only if i type .aspx in de url.
e.g. /test.aspx does work, it redirects to the right page, but /test doesn't work i get a 404.
Could it have anything to do with how asp.net handles requests without .aspx?
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 24 January 2011 at 5:45am

Where do you need /test request to be directed? What is the destination for this request?

__________________
Regards,
Anton
Back to Top
 
Chimney72
Newbie


Joined: 21 January 2011
Posts: 5
Posted: 24 January 2011 at 6:00am

Doesn't matter, say info.php. Finally i should be able to get
RewriteRule ^([a-zA-Z0-9_-]*)/([a-zA-Z0-9_-]*)/?$ ./index.php?parent=$1&paginanaam=$2 [L]
But first i need to figure out why /*.aspx is redirecting and /* is not, i don't want to change all links so that there is .aspx in them.
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 24 January 2011 at 8:24am

Well, your situation is rather strange.
Firstly, please tell if you have any other ISAPI filters registered.
And also if it's possible to get remote access to your server to try figure out the problem.

__________________
Regards,
Anton
Back to Top
 
Chimney72
Newbie


Joined: 21 January 2011
Posts: 5
Posted: 24 January 2011 at 11:50am

I thought it was strange too. My hosting provider had told me mod-rewrite was enabled, but today they found out it was not. They enabled it and now everything is working fine. You can imagine i was pretty [email protected]#$%
Sorry to have bothered you with it, but thanx for your replies.
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