Articles of 重写

IIS WordPress站点上的替代端口和重写规则

我有2个网站运行在一个服务器与2个不同的主机名。 让我们打电话给他们 1 – hostname1.host.com 2 – hostname2.host.com hostname1.host.com绑定到一个WordPress站点, hostname2.host.com绑定到一个ASP.NET MVC站点。 另外还有两个MVC站点作为QA,分别在端口8000和8008上运行。 这些可以自然地通过主机名或者只是在服务器的IP地址上被访问。 截至昨天,WordPress的网站已经过时了。 我已经绑定了hostname1.host.com到MVC站点,因为这是我想要使用的,并且从WordPress站点的绑定中删除了这个主机名。 我有2个全局的URL重写规则: 第一条规则将除服务器的IP地址之外的所有stream量redirect到hostname1.host.com但端口8080和8008除外。 第二条规则将hostname2.host.com上的所有stream量redirect到hostname1.host.com 。 我也包括这个规则的端口。 然后,在现场MVC网站上,我也有一个规则,redirect所有80端口的stream量到443 : 我遇到的问题是要将WordPress网站绑定到端口8080不工作。 我有: 在我的网站上我有绑定(只要想象下红色说hostname1.host.com): 当我尝试访问任何域上的WordPress站点或端口8080上的IP地址时,会发生什么?我得到redirect: <h1>Object Moved</h1>This document may be found <a HREF="http://hostname1.host.com/">here</a> 这不应该发生。 不应该有将端口8080redirect到主机名的规则。 我仍然可以访问分期和QA网站就好了。 我甚至尝试用WordPress站点的端口交换QA站点的端口。 然后我可以在端口8080上访问QA站点,但是端口8000redirect到主机名。 从IIS日志中: 有很多这样的: #Software: Microsoft Internet Information Services 8.5 #Version: 1.0 #Date: 2016-11-24 12:27:57 #Fields: date time […]

Nginx重写的URL无法redirect

我一直在尝试将types为https://subdomain.example.com/dash/#/story/9483的特定urlredirect到https://subdomain.example.com/dash/#/story/9483 我已经尝试使用这个重写规则,但它始终在最后添加?id=9483 。 rewrite ^/story_meta_info\.php.* https://$host/dash/#/story/$arg_title redirect; 我在某处做错了什么?

haproxy重写规则reqirep日志

我有一堆haproxy重写规则为特定的后端,有没有办法将完整的URLlogin到haproxy日志中的后端? 这里是我的configuration文件中的示例.. reqirep ^([^ \] )\ / myservice / api / v6 / offers /(。 )\ 1 \ / new / v1 / offerdetailpage / offers / \ 2 对于haproxy日志中的请求http://example.com/myservice/api/v6/offers/1234 ,我能够看到后端名称和实际的传入请求URL,我想要看到/ new / v1 / offerdetailpage / offers / 1234以及haproxy logs ..有可能吗? 你能告诉我哪个日志字段应该configuration得到代理请求path吗?

IIS https https

我正在尝试使用IIS重写模块将httpsredirect到另一个https。 这是我曾经试过的: testing1: <rewrite> <rules> <rule name="Redirect Maps Rule" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{StaticRedirects:{PATH_INFO}}" pattern="(.+)" /> </conditions> <action type="Redirect" url="{C:1}" appendQueryString="True" redirectType="Permanent" /> </rule> </rules> <rewriteMaps> <rewriteMap name="StaticRedirects"> <add key="https://sub.olddomain.com/sitename" value="https://sub.newdomwain.co.uk/sitename" /> </rewriteMap> </rewriteMaps> </rewrite> testing2: <rule name="https test" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAny"> <add input="{URL}" pattern="https://sub.olddomain.com/sitenam$" /> </conditions> <action type="Redirect" appendQueryString="false" […]

redirect到我的Laravel项目文件夹

我在.htaccess文件中有以下内容。 我希望它redirect到我的项目文件夹/hc是在.htaccess相同的水平。 redirect没有发生,它仍然显示index.html的内容。 RewriteEngine On RewriteBase /hc/ <Files .*> Order Deny,Allow Deny From All </Files> RewriteCond %{HTTP_HOST} ^example.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php?/$0 [PT,L,QSA]

nginx – 301redirect/子文件夹1 /一些友好的url-12345到/子文件夹2 /一些友好的url

我是nginx上的新手。 我有一些旧的url,比如/ aaaaa / some-friendly-url-12345 ,我想301将这些urlredirect到新的url,但没有ID,比如/ bbbbb / some-friendly-url 。 我也想redirect/ aaaaa / to / bbbbb / 我尝试了一些位置指令,但我无法成功。 这是我试过的一个: location ~ /aaaaa/(?P<a_slug>.*)$-(?P<a_id>.*) { return 301 https://domain.com/bbbbb/$a_slug; } 谢谢。

Nginx重写/购物/任何东西/购物

我们在我们的网站上使用了一个embedded式的电子商务商店,它通过将所需的JS脚本添加到/shop页面来工作。 在服务器端,现在的要求是,计划/shop/anything所有URL /shop/anything被重写到/shop为服务器/shop ,因为该部分的其余部分是由embedded式JS商店处理的。 我不能写这个, rewrite or internal redirection cycle while processing "/shop正在进行rewrite or internal redirection cycle while processing "/shop我认为这只是对正则expression式的处理,但我似乎无能为力。 我的设置如下: server { listen 8002 default_server; listen [::]:8002 default_server; location / { root /home/mysite; rewrite ^/shop/.+$ /shop; index index.php; fastcgi_split_path_info ^(.+\.php)(/.+)$; try_files $uri $uri/ /index.php?$query_string; set $path_info $fastcgi_path_info; fastcgi_param PATH_INFO $path_info; fastcgi_index index.php; include fastcgi_params; […]

nginx从web根目录redirect到404,然后尝试b

我试图修改我的nginxconfigurationredirect从web根(“/”)到/ dir-a ,然后如果这将返回404redirect到/ dir-b 。 我不完全确定如何或如果这是可能的,但。 这是我迄今为止… location = / { rewrite "/" /dir-a permanent; } 但是,这返回404页,所以我不知道从哪里去。 我需要它来代替dir-b。

nginx重写中断django?

我有Django运行在Nginx之后。 其中一个域提供图像文件,如果存在这样的文件,则从本地文件系统上的caching中提取;如果不存在,则用django脚本提供。 要从机器人隐藏真实的文件名我有时想洗牌文件中的字符。 在这种情况下,url有一个“/ x /”前缀。 这是我在nginxconfiguration的尝试: server { listen 80; server_name mydomain.com; client_max_body_size 5M; access_log /var/log/nginx/mydomain.access.log; location /robots.txt { root /srv/www/mydomain.com; } rewrite ^/x/(.)(.)(.)(.)(.)(.)(.*)$ $5$2$6$3$1$4.jpg last; location ~* ^.+\.(jpeg|gif|png|jpg|webp) { root /srv/imagecache; try_files /$uri @aws; } location @aws { fastcgi_pass unix:/srv/django/myapp/myapp.sock; fastcgi_param SERVER_NAME $server_name; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param […]

了解IIS 8.0使用正则expression式将https的入站规则重写为httpredirect

我设法使用这个答案为我的网站configuration一个重写规则: <rule name="Redirect from non www" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTP_HOST}" pattern="^example.com$" /> </conditions> <action type="Redirect" url="https://www.example.com/{R:0}" redirectType="Permanent" /> </rule> <!– this is the rule I am interested in –> <rule name="Redirect from non https" stopProcessing="true"> <match url=".*" /> <conditions> <add input="{HTTPS}" pattern="^OFF$" /> <add input="{HTTP_HOST}" pattern="^www.example.com$" /> </conditions> <action type="Redirect" url="https://www.example.com/{R:0}" redirectType="Permanent" […]