Forum Moderators: phranque
Html is dynamically generated and sorry, but can't avoid a few relative links in there. Links are pulling some MS stuff (mainly scripts) from a remote 'friendly' IIS, or at least people there claim they're friends?! Please, help me decide if they are (dis) honest or they are just lazy? ;) And yes, I know that many of you would put it plainly that a MS IIS can never be friendly... :)
It concerns a website that still has a very low traffic. So, I thought I can afford an extra uri check per every new visitor. Time will tell. Lets keep getremote.php page aside for the time being as it'll be another saga (header context calls, sid's, postbacks, time stamps etc.) and hopefully Part II.
Ok, if I tell you what I've done so far you can pretty easily guess what I'm trying to achieve.
RewriteEngine On
#=== RewriteCond %{IS_SUBREQ} true ===# let's stay that way for now
RewriteCond $1 \.(asp¦aspx¦axd¦asmx)$
RewriteCond %{REQUEST_URI} !-U
RewriteRule ^(.+)$ /getremote.php?page=$1&qstring=%{QUERY_STRING} [L]
Questions...
1. Can I expect any conflicts with, say "ErrorDocument 404 /error.php?doc=404" if error.php?doc=404 is my default 404 error page?
2. What is more time consuming for the web server:
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
or just
RewriteCond %{REQUEST_URI} !-U
3. I deliberately avoid using [QSA] because the original query name parameter can change from time to time (value changes every time). Setting the name parameter to my own choice gives me easy (and solid) way to capture its value on getremote page. I don't feel comfortable, however, working with query strings looking like this:
?page=resource.axd&qstring=q=qyGie8o2P6h3qV99WmgRXqrg2&t=633505882101468979
It might be a time bomb. Do you think putting %{QUERY_STRING} in ENV variable for further processing on getremote page is a better approach?
Sorry for being a little bit too detailed.
1. Can I expect any conflicts with, say "ErrorDocument 404 /error.php?doc=404" if error.php?doc=404 is my default 404 error page?
What do you mean by "conflict". You won't face a direct conflict.
2. What is more time consuming for the web server:
Do you think putting %{QUERY_STRING} in ENV variable for further processing on getremote page is a better approach?