server-variables

Regex for URL rewrite with optional query string parameters

百般思念 提交于 2020-01-04 10:43:31
问题 I have this rewrite rule: <rule name="rentals by proptype+state+city+street test" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{UNENCODED_URL}" pattern="^/([a-zA-Z0-9\-+]+)/rent/province/([a-zA-Z\-+]+)/street/([a-zA-Z0-9%\-+]+)/([0-9a-zA-Z%\-+']+)$" /> </conditions> <action type="Rewrite" url="search_new.aspx?proptype={C:1}&province={C:2}&city={C:3}&street={C:4}" appendQueryString="true" /> </rule> I also tried: <rule name="rentals by proptype+state+city+street test"

Regex for URL rewrite with optional query string parameters

断了今生、忘了曾经 提交于 2020-01-04 10:43:08
问题 I have this rewrite rule: <rule name="rentals by proptype+state+city+street test" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{UNENCODED_URL}" pattern="^/([a-zA-Z0-9\-+]+)/rent/province/([a-zA-Z\-+]+)/street/([a-zA-Z0-9%\-+]+)/([0-9a-zA-Z%\-+']+)$" /> </conditions> <action type="Rewrite" url="search_new.aspx?proptype={C:1}&province={C:2}&city={C:3}&street={C:4}" appendQueryString="true" /> </rule> I also tried: <rule name="rentals by proptype+state+city+street test"

Server variables and the .js file. Is it possible?

我的未来我决定 提交于 2019-12-25 04:49:20
问题 is it possible to invoke server variables in the external .js file ? [Edit] OK, I resolved the problem, thank for Your help ! :) 回答1: No, internal JS you can <script> var i = <%= ServerSideVar %> </script> 回答2: When you say, "invoke a server variable" do you mean you want to change the value of a variable or did you mean to say, "invoke a function on the server?" This can be done using an ajax call back to the server (assuming you are trying to avoid a postback). 回答3: Use Page.ClientScript

$_SERVER[“SCRIPT_URL”]: when is it reliably present?

我与影子孤独终老i 提交于 2019-12-23 07:59:11
问题 In my local environment (PHP 5.4.24 on Apache 2.2.26) $_SERVER["SCRIPT_URL"] is present, but I read around that this variable is not always present, even though I couldn't find exactly when it is and when it isn't. I'd like to know what is required for this variable to be reliably present. 回答1: It's only available when you have mod_rewrite enabled: http://httpd.apache.org/docs/2.0/rewrite/rewrite_intro.html#EnvVar 回答2: This variable strongly depends on the server's configuration. When using

serving different content based on the domain in codeigniter

爷,独闯天下 提交于 2019-12-23 05:26:35
问题 I'm going to develop a website in codeigniter. But not sure if the methor i'm going to use is the best approach. There will be many addon domains for the same site. But content will be filtered based on the domain used to visit the site. For Example If a user comes from the domain siteusa.com then the content will be shown filtered accordingly specific user. If the user comes from siteuk.com/sitechina.com the content will be filetered accordingly etc... I'm planning to do something like this

How can you “footprint” a specific computer behind a firewall using HttpContext?

﹥>﹥吖頭↗ 提交于 2019-12-22 10:48:36
问题 I have a need to be able to identify one system from another in ASP.Net using anything available in HttpContext. I've attempted to use many of the ServerVariables available, but often the systems are configured from a drive built off of an image. So, because of the firewall their IP address is the same and all of their ServerVariables (browseragent, logonuser) are the same, I need to find something else that will tell different machines apart. Since the site is secured with

Setting HTTP_X_FORWARDED_FOR server variable in classic ASP

橙三吉。 提交于 2019-12-11 12:42:56
问题 I need to set the HTTP_X_FORWARDED_FOR value in the Request.ServerVariables collection. I'm trying with Fiddler (see this article). So I set up a custom HTTP request: GET http://myhost/ HTTP/1.1 http_x_forwarded_for: my.fake.ip.1, my.fake.ip.2 Host: myhost. The request is correctly executed. But when I debug the code, the Request.ServerVariables("HTTP_X_FORWARDED_FOR") is empty. Where am I wrong? Is Fiddler the correct tool? 回答1: The header you are sending should be x-forwarded-for . The

DOCUMENT ROOT variable on PHP-IIS

我是研究僧i 提交于 2019-12-10 22:54:33
问题 Does the $_SERVER["DOCUMENT_ROOT"] variable exist on IIS running PHP? Earlier I thought this variable is Apache specific and on IIS, you have to emulate it by string manipulation of SCRIPT_NAME and SCRIPT_FILENAME variables but I now see this variable on my PHP installation on IIS. Is it safe to assume that this variable will always be available on IIS. 回答1: Is it safe to assume doc root is always available in IIS? No... $_SERVER['DOCUMENT_ROOT'] is not always available on IIS.. it has to be

What does the utmscr or utmcct values mean in reference to the Http cookie Server variable?

风格不统一 提交于 2019-12-09 09:49:46
问题 What does the utmscr and/or utmcct values mean in reference to the Http cookie Server variable? Are they acronyms or short for something? We are getting Elmah errors with the title "System.Web.HttpException: Unable to validate data." In each Elmah error message, the Http Cookie server variable value contains a property called utmscr set to the same Web site and utmcct set to a page at that Web site. Here is a section from the Http Cookie Value from the Elmah Server variables dump. utmccn=

mod_rewrite & PHP; $_SERVER['REQUEST_URI'] vs. mod_rewrite

做~自己de王妃 提交于 2019-12-08 03:02:34
问题 Quick one: I'm curious if anyone knows of certain circumstances under which $_SERVER['REQUEST_URI'] would contain a different value than $_GET['_uri'] , given the following .htaccess for the latter: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ ?_uri=$1 [L,QSA] I've been using the latter method $_GET['_uri'] , and while I'm aware that mod_rewrite would still be necessary, I'd like to get away from storing the URI as a query parameter. Well, I've