Articles of 重写

IIS 7.5 URL重写 – 缺less“路由到服务器”选项

(从StackOverflow中移出的问题) 我正在运行Windows 7旗舰版,并已启动IIS(版本7.5.7600.16385)。 我已经使用Microsoft Web平台安装程序2.0安装了以下模块: * IIS URL Rewrite Module 2 * Microsoft Application Request Routing Version 2 for IIS 7 * Microsoft Web Farm Framework Version 1 for IIS 7 * Microsoft External Cache Version 1 for IIS 7 现在我正在尝试使用“路由到服务器”选项来configurationURL重写规则。 但是,在“编辑入站规则”页面中,不存在这样的选项:我有的所有可用的是: * Rewrite * None * Redirect * Custom Response * Abort Request 为什么没有“路由到服务器”选项? […]

哪些工具或技术可用于pipe理Apache的大量重写规则?

[注意:我在Stack Overflow上提出这个问题,有人build议我来这里。 我在这里search,发现这是接近我的问题,但不完全。 在我们的Apacheconfiguration中,我们目前有超过450个重写规则,跨4个不同的文件。 正如你所想象的,它们对于我们网站的运作方式至关重要。 我们当然要检查我们所添加的所有规则,把它们放在git中,并确保它们保持正确的顺序,以便不会踩到彼此的脚趾,但随着产品的全时开发,这个数字可能只会增加。 你用什么工具和/或技术来维护这种重要的(和潜在危险的)configuration? 你有什么保障措施来确保devise不当的重写规则不会意外地把大部分的网站带走? [以前的服务器故障线程提到RewriteMap,这似乎是一个有趣的工具,但不太适合解决我们的特定问题。]

我怎样才能301从一个url格式的所有stream量redirect到另一个?

由于我们已经将模板名称从template-a更改为template-b,并且需要将所有链接301更改为新的template-b URL,所以我一直在努力处理基本的重写规则。 例: /信任的安装程序/模板-A /东西,这里/和可能,在这里 应该301redirect到: /信任的安装程序/模板-B /东西,这里/和可能,在这里 我知道我需要一个模式匹配和R = 301,但到目前为止,我还没有得到这个工作是正确的。 任何快速的build议将非常乐意接受。

nginx proxypath httpsredirect失败,没有结尾斜杠

我试图设置Nginx使用proxy_pass转发请求到几个后端服务。 缺less结尾斜杠的页面上的链接确实在前面有https:// ,但是被redirect到一个带有斜杠的http请求 – 这些连接以拒绝连接结束 – 我只希望通过https访问这些服务。 所以如果一个链接太https://example.com/internal/errorlogs 在浏览器中加载时https://example.com/internal/errorlogs给出Error Code 10061: Connection refused (redirect到http://example.com/internal/errorlogs/ ) 如果我手动追加testing斜杠https://example.com/internal/errorlogs/加载 我已经尝试了不同的尾随正斜杠附加到proxypath和proxy.conf中的位置无效,也添加了server_name_in_redirect off; 这发生在nginx下的多个应用程序,并在Apache反向代理工作 configuration文件; proxy.conf location /internal { proxy_pass http://localhost:8081/internal; include proxy.inc; } …. more entries …. /主启用的站点 – server { listen 443; server_name example.com; server_name_in_redirect off; include proxy.conf; ssl on; } proxy.inc proxy_connect_timeout 59s; proxy_send_timeout 600; proxy_read_timeout 600; […]

htaccess:如何重写清理url,并将旧urlredirect到新的清理url?

与htaccess我试图让我的网站urls干净。 我使用非常基本的URL:www.mysite.com/pagename.php(“pagename”是可变的)。 我想要www.mysite.com/pagename显示/pagename.php的内容 所以这是在我的htaccess文件现在: Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] 但是我也希望我的旧url(/pagename.php)在被调用时被重写为www.mysite.com/pagename 这个怎么做? 我无法弄清楚(一直得到循环)… 提前致谢!

mod_rewrite:内部重写为(假)干净的URL不可能。

这更是一个为什么问题。 我正在使用CMS,通过开箱即用的mod_rewrite处理干净的URL。 网站有一个部分/accessories ,现在必须重新命名为/store 。 在懒惰模式下,我只是想使用mod_rewrite进行内部重写,因此,在访问example.com/store/ ,我希望透明地从example.com/accessories内容,而不需要任何外部redirect。 到目前为止,我已经试过这个: RewriteEngine On # Internally rewrite /store to /accessories RewriteRule ^store /accessories [L] #also tried with other flags like PT, N, C # All below rules are provided by CMS RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L] RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*) index.php 但没有任何工作 […]

我可以configurationIIS 7+根据传入的主机名执行dynamic反向代理吗?

我正在尝试将IISconfiguration为根据传入的主机名来代理请求。 例如,如果我的代理服务器是位于www.proxy.com的IIS服务器,那么www.google.com.www.proxy.com的请求将代理到www.google.com 我试图设置一个带有URL重写规则的反向代理,将*localhost*重写为{R:1} {R:2},但我没有任何运气。 从我读过的内容来看,只有在指定了我想要提前与哪个服务器进行交互的情况下才有可能,但在我的情况下,这是不可能的(服务器在EC2上,并且一直被dynamic地创build和终止)。

在Apache + Tomcat中进行URL重写,并在Web应用程序上下文中进行更改

如何使URL http:/ hostname:8080 / abc?func = ll自动指向URL http:/ hostname:8080 / xyz?func = ll。 设置Apache是​​Tomcat存在的后面。 应用程序“xyz”部署在Tomcat上。 应用abc不存在。 所有的请求只能通过Apache进入tomcat。 所有意见都受到重视和欢迎。 请帮忙 关于Abinash

nginx:未知的“script_filename”variables

我尝试使用script_filename时收到此错误 nginx: [emerg] unknown "script_filename" variable nginx: configuration file /etc/nginx/nginx.conf test failed 但是script_filename在fastcgi_params定义 fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; […]

nginx:上传进度和重写子句

我正在使用nginx上传进度扩展和一些重写子句。 一切正常,只要我上传表单上传到一个PHP文件( <form action="myphpfile.php" … > )。 但是当我在我的动作参数( <form action="myhtmlfile.htm" …> )中使用html文件时,我只通过请求上传状态来获得“({status:starting})”。 但是…我所有的网页都是从htm改写为php,使用我的nginx-conf中的以下位置部分: location ~ \.(php|htm)$ { rewrite ^/([a-zA-Z0-9]+).htm$ /index.php?page=$1 last; client_max_body_size 0; include /etc/nginx/fastcgi_params; track_uploads uploads 30s; } 我的位置或重写条款有什么问题吗? 但是…这些组合适用于其他任何东西,所以我目前有点困惑,为什么我只通过在窗体的action-parameter中使用php-files来获得正确的状态。 编辑:我的完整configuration如下: user nginx; worker_processes 1; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; log_format main '$remote_addr […]