uri

.htaccess

馋奶兔 提交于 2019-12-30 09:58:04
一. 在Apache配置中启用Rewrite 打开配置文件httpd.conf: 1.启用rewrite # LoadModule rewrite_module modules/mod_rewrite.so 去除前面的 # 2.启用.htaccess 在虚拟机配置项中 AllowOverride None 修改为: AllowOverride All 3.打开phpinfo看一下 (例如:http://localhost/?phpinfo=1) 二、Rewrite基本写法 Rewirte主要的功能就是实现URL的跳转,它的正则表达式是基于Perl语言。可基于服务器级的(httpd.conf)和目录级的 (.htaccess)两种方式。 服务器有配置文件不可能由我们来改,所以大多情况下要在网站的根目录下建一个.htaccess文件。 RewriteEngine on //启动rewrite引擎 RewriteRule ^/index([0-9]*).html$ /index.php?id=$1 //“([0-9]*)” 代表范围 用(.*)代表所有,下同。 RewriteRule ^/index([0-9]*)/$ /index.php?id=$1 [R] //虚拟目录 注:RewriteRule 正则 替代($1,$2 跟正则里的一样,代表括号里的东西) 【但这里没有有/?的转义】

How can I read the URL parameter in a Perl CGI program?

自古美人都是妖i 提交于 2019-12-30 03:18:09
问题 How can I read the URL parameter in a Perl CGI program? 回答1: For GET requests , CGI parses the specified parameters and makes them available via the param() method. For POST requests , param() will return the parameters from the postdata, but any parameters specified via a query string in the URL itself are still available from the url_param() method. (This is can be helpful when a POST request is larger than $CGI::POST_MAX ; in that case, CGI just discards the postdata, but you can arrange

“Exported activity does not require permission” when attempting to launch from a URI

无人久伴 提交于 2019-12-30 01:34:14
问题 I am trying to launch an Android app from a URI using this SO question as a reference. I have a manifest file with the following declared activity: <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.VIEW" /> <data android:scheme="http" android:host="example.com" /> </intent-filter> </activity> I am attempting to launch MainActivity with the http://example.com link. My issue is that I get the warning "exported activity does not require

UriFormatException : Invalid URI: Invalid port specified

眉间皱痕 提交于 2019-12-29 12:03:30
问题 The assembly qualified string used as a parameter below for a Uri works in XAML, but gives me the error shown when used in code. I tried every kind of UriKind with the same result. How can I fix this? [Test] public void LargeImageSource_IsKnown() { var uri = new Uri( "pack://application:,,,/" + "MyAssembly.Core.Presentation.Wpf;component/" + "Images/Delete.png", UriKind.RelativeOrAbsolute); Assert.That( _pickerActivityCollectionVm.DeleteActivityCommand.LargeImageSource, Is.EqualTo(uri)); }

WebBrowser Madness

旧城冷巷雨未停 提交于 2019-12-29 09:08:10
问题 Edit: The original question was a long one with many wild guesses. I have cut it back to the remaining mysteries.. I've been struggling and puzzling all day now and guess I ought to present my problem to the community. It originated from the post called Screenshot method generates black images. The original poster wants to continuously take screenshots of his program, which includes a WebBrowser, every n seconds even when the user is logged off . When the user is logged out he has no screen

Spring does not ignore file extension

时间秒杀一切 提交于 2019-12-29 07:10:05
问题 In my Spring XML I have the following snippet: <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"> <property name="useDefaultSuffixPattern" value="false"/> </bean> <mvc:annotation-driven> <mvc:message-converters> <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"> <property name="objectMapper" ref="objectMapper" /> </bean> </mvc:message-converters> </mvc:annotation-driven> From what I understand, this means that

偷懒小工具 - SSO单点登录通用类(可跨域)

邮差的信 提交于 2019-12-29 03:45:48
写在前面的话 上次发布过一篇同样 标题的文章 。但是因为跨域方面做得不太理想。我进行了修改,并重新分享给大家。 如果这篇文章对您有所帮助,请您点击一下推荐。以便有动力分享出更多的“偷懒小工具” 目的 目的很明确,就是搭建单点登录的帮助类,并且是一贯的极简风格(调用方法保持5行以内)。 并且与其他类库,关联性降低。所以,不使用WebAPI或者WebService等。 思路 因为上次有朋友说,光看见一堆代码,看不见具体思路。所以,这次分享,我把思路先写出来。 懒得看实现代码的朋友,可直接查看 “思路” 这个子标题。 同时如果有好的想法, 请修改后在github上推给我。Talk is cheap,Show me the code 同域 同域需要考虑的问题比较少。只需要考虑,MVC和WebForm的Request如何获取即可。 实现流程图如下 1. 因为是使用同样的Cookie所以名称和加密方式必须一致。 2. 需要设置登录成功后,回跳的网址。因为Forms身份认证的ReturnURL不能获得请求原网址。 3. 剩下的就如图所示了。不明白的可以追问,我就不细说了。 跨域 跨域除了需要考虑同域的问题外,还需要考虑状态共享。因为同源策略问题,故此使用 JSONP 。 1. 因为不是Cookie共享,所以只需要设置相同的加密方法即可。 2. 需要在认证网站,添加可登录的其他网站集合

Image capture with camera & upload to Firebase (Uri in onActivityResult() is null)

瘦欲@ 提交于 2019-12-29 01:27:26
问题 So I've got a problem, previously mentioned in the question I've asked: Uploading image (ACTION_IMAGE_CAPTURE) to Firebase storage I've searched for the issue a bit more, and applied the Android Studio documentation: https://developer.android.com/training/camera/photobasics.html#TaskPhotoView So, before you read the code , I basically want to say what is needed : I just want to capture a photo with camera and upload it directly to Firebase storage. To do that I need the Uri to contain the

Nginx 配置简述

倾然丶 夕夏残阳落幕 提交于 2019-12-29 00:27:43
不论是本地开发,还是远程到 Server 开发,还是给提供 demo 给人看效果,我们时常需要对 Nginx 做配置,Nginx 的配置项相当多,如果考虑性能配置起来会比较麻烦。不过,我们往往只是需要一个静态 Server,或者一个反向代理 Server,这对 Nginx 来说小菜一碟。 本文将给大家介绍 Nginx 配置的基本知识,不想细看的同学可以直接跳到最后一个例子。 简介 Nginx 的安装就不解释了,方便起见,建议在各平台可以直接执行对应安装命令: # CentOS yum install nginx; # Ubuntu sudo apt-get install nginx; # Mac brew install nginx; 一般可以在 /etc/nginx/nginx.conf 中配置,启动参数为: # 启动 nginx -s start; # 重新启动,热启动,修改配置重启不影响线上 nginx -s reload; # 关闭 nginx -s stop; # 修改配置后,可以通过下面的命令测试是否有语法错误 nginx -t; -s ,signal,意思就是向 nginx 发送 start|reload|stop 命令,还是很好理解的。先看一个最简单的 nginx.conf 配置: events { # 需要保留这一个段落,可以为空 } http { server

Get browser history and search result in android

荒凉一梦 提交于 2019-12-28 12:51:09
问题 I am trying to get the history and search results from the android browser. In the following code I get all the bookmarks, which works great: public void getBrowser(){ String[] requestedColumns = { Browser.BookmarkColumns.TITLE, Browser.BookmarkColumns.VISITS, Browser.BookmarkColumns.BOOKMARK }; Cursor faves = managedQuery(Browser.BOOKMARKS_URI, requestedColumns, Browser.BookmarkColumns.BOOKMARK + "=1", null, Browser.BookmarkColumns.VISITS); Log.d(DEBUG_TAG, "Bookmarks count: " + faves