Forum Moderators: phranque

Message Too Old, No Replies

.htaccess .asp / .aspx rewrites not working while other's are

.asp url rewrites not working while other extension's redirects are fine

         

gcarn

8:12 pm on May 12, 2010 (gmt 0)

10+ Year Member



I'm working on a website that has been switched from asp to php.
I need to redirect some .aspx requests to .php files.

This rewrite rule works fine:

rewriterule ^contact.test$ http://www.example.com/contact.php [R=301,L]

And this rule fails with the error described below:

rewriterule ^contact.asp$ http://www.example.com/contact.php [R=301,L]

The .asp rule results in this error : "This domain is not configured for this service. Please contact the webmaster to have it enabled."

It seems that the error is happening, before the .htaccess rule is executed. (since the .test example seems to work)

Any thoughts / solutions on how to solve this dilemma, or what is causing it, would be greatly appreciated

[edited by: jdMorgan at 12:33 am (utc) on May 13, 2010]
[edit reason] Please use example.com only [/edit]

jdMorgan

12:38 am on May 13, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sounds like there is a directive in a higher-level .htaccess file or a server config file that is either reverse-proxying .asp requests to another server, or perhaps an Alias, ScriptAlias, or AddHandler directive that is rewriting .asp requests to a different filepath, so that your .htaccess code is never applied.

Consult with your host or server admin, and/or dig around in your control panel -- There may be an option to "remove .asp service/program/feature" that hasn't been used yet, and would remove this directive if you used it.

Jim

gcarn

4:08 pm on May 13, 2010 (gmt 0)

10+ Year Member



Thanks for the advice, we're wating on a reply from the host, I will update when /if we come to a solution

jdMorgan

4:41 pm on May 13, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Additional causes of problems are that MultiViews (content negotiation, see mod_negotiation) are enabled, or on Apache 2.x, that AcceptPathInfo is enabled, when neither are needed. These two features also do "rewrites" and can take precedence over mod_rewrite.

If you don't use them, then you can disable these features by adding "-MultiViews" to your existing .htaccess Options directive and/or by adding the "AcceptPathInfo Off" directive on a new line.

Jim