rewrite or remove .asp from a url

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 1
Joined: 16 Jul 2012, 10:42

rewrite or remove .asp from a url

16 Jul 2012, 10:51

I have a page that I need to be visitmw.asp to visitmw without the .asp. Can anyone help. I tried using the code from one of your examples but I couldn't get it to work I assume this is a javascript code and put it in the head of my document and where the {REQUEST_FILENAME} I put the filename visitmw in. I don't know if this is right or not but if someone could please help I would appreciate it:
Code: Select all
RewriteEngine on

#Redirect extension requests to avoid duplicate content
RewriteRule ^([^?]+)\.asp$ $1 [NC,R=301,L]

#Internally add extensions to request
RewriteCond %{REQUEST_FILENAME}.asp -f
RewriteRule (.*) $1.asp


Thanks, Michelle

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: rewrite or remove .asp from a url

17 Jul 2012, 06:02

Hello,

Javascript? No.
You need to use ISAPI_Rewrite Manager of notepad to edit .htaccess OR httpd.conf files. To get a better understanding ,please, see [code=http://www.helicontech.com/isapi_rewrite/doc/concept.htm]documentation[/code].

The rule is right, although you might need "RewriteBase /" after the "RewriteEngine on"

Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 26 guests