Maprule Overwriting "index.html"
3 posts
• Page 1 of 1
Maprule Overwriting "index.html"
Hello, I was able to get ISAPI Rewrite working for my "browse.aspx" page. It accepts the "ID" param and allows me to search for records as their own directory name like "www.mydomain.com/customname"
Here is the code that I'm using:
RewriteBase /
RewriteMap mapfile txt:mapfile.txt
RewriteRule ^([^\.\?]+)/?(\?.*)?$ /browse.aspx?team=${mapfile:$1}
But the problem is when I try to load my mobile domain such as "www.mydomain.com/m" it also bounces back to my "browse.aspx" page. It appears that the code I'm using is overwriting my default documents. Could someone please help me determine how not overwrite default documents in other directories as I just want to run the "browse.aspx" page?
Here is the code that I'm using:
RewriteBase /
RewriteMap mapfile txt:mapfile.txt
RewriteRule ^([^\.\?]+)/?(\?.*)?$ /browse.aspx?team=${mapfile:$1}
But the problem is when I try to load my mobile domain such as "www.mydomain.com/m" it also bounces back to my "browse.aspx" page. It appears that the code I'm using is overwriting my default documents. Could someone please help me determine how not overwrite default documents in other directories as I just want to run the "browse.aspx" page?
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Maprule Overwriting "index.html"
Hello,
You'll need to exclude certain pages using either separate rule or additional condition as in following:
please, make sure the following rule is the first in your config file
OR add a condition to an existing rule
Regards
Andrew
You'll need to exclude certain pages using either separate rule or additional condition as in following:
please, make sure the following rule is the first in your config file
- Code: Select all
# this checks for a default page and rewrites it for itself.
RewriteCond %{REQUEST_URI} ^/(?:m|index.asp|otherPageName|etc).* [NC]$
RewriteRule .* - [NC,L]
OR add a condition to an existing rule
- Code: Select all
# this checks if it's NOT a default page
RewriteMap mapfile txt:mapfile.txt
RewriteCond %{REQUEST_URI} !^/(?:m|index.asp|otherPageName|etc).* [NC]
RewriteRule ^([^\.\?]+)/?(\?.*)?$ /browse.aspx?team=${mapfile:$1}
Regards
Andrew
Re: Maprule Overwriting "index.html"
Ok great! I didn't have the RewriteCond added. Thanks for your help!!
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests