rewrite or remove .asp from a url
2 posts
• Page 1 of 1
rewrite or remove .asp from a url
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:
Thanks, Michelle
- 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
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: rewrite or remove .asp from a url
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
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
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 26 guests