Articles of 重写

在web根目录中服务PHP页面,但在子目录中显示内容

我有一个共享的托pipe服务器上的网站。 我的目录布局看起来像这样 /home /user /public_html /pics /family public_html中有一个index.php文件。 我需要帮助编写.htaccess规则 当www.domain.org被请求时,服务index.php文件 请求www.domain.org/pics时强制用户回到public_html 允许用户在请求www.domain.org/pics/family时查看目录内容 我尝试了很多RewriteCond和RewriteRule的组合,但是我不明白这些文档和例子足以知道我想要做什么甚至是可能的。 Web服务器应用程序是Apache的某个版本。

在非WordPress页面中使用WordPress插件时,IE9中的链接会中断

我有一个使用SEF URL和htaccess RewriteRules来提供页面的网站。 这一直工作好几年,直到IE9的到来。 现在看来,这些链接并没有被重写,网站已经死在了水中。 我已经尝试了不同的兼容模式,无济于事,我一遍又一遍地玩了重写规则,尝试了不同的文档types和一些其他的浏览器设置。 我同意,如果问题是与htaccess文件,但是这个网站在IE8,Firefox和铬的作品,理论上不能成为一个浏览器的具体问题。 我已经通过validation程序运行rewriterule,它看起来很好。 任何想法将不胜感激,因为我正在用尽想法。 该网站是www.marlboroughsounds.co.nz示例链接 http://www.marlboroughsounds.co.nz/walking/freedom-walk-queen-charlotte-track/4dfw 和重写规则不工作看起来像这样: RewriteRule ^walking/.*/([a-z0-9_]*)/?$ /walking.php?act_code=$1 [L] 链接失败,它提供了一个浏览器404页面,甚至没有我为该网站的自定义404。 任何想法将非常赞赏,因为我难住。

Apache的mod_rewrite url重写

我想用mod_rewrite从http://www.server.com/directory/public重写到http://www.server.com/directory (其中目录然后指向目录/ public) 我尝试了几件事,但我无法弄清楚。 这是我的configuration: <VirtualHost xxx.xxx.xxx.xxx:443> ServerAdmin [email protected] ServerName www.server.com DocumentRoot /var/www/server.com <Directory /var/www/server.com> RewriteEngine on RewriteCond %{REQUEST_URI} ^/directory RewriteRule ^(.*)$ /directory/public/ [L] </Directory> </VirtualHost>

nginx wordpress重写规则与stub_status模块冲突

我有一个问题,当我试图启用stub_status模块在我的WordPress的网站。 以下是我在nginx.conf中的configuration。 location /status { stub_status on; access_log off; } if (!-e $request_filename){ rewrite ^(.+)$ /index.php?q=$1 last; } 我的问题是我可以访问状态页面,如果我删除了WordPress的重写规则。 如果存在重写规则,则状态页面不起作用。 有谁知道如何解决这个问题?

是否有可能在apache2dynamicproxy_remote_match指令或以某种方式解决它?

我正在运行一个转发代理,我想使用ProxyRemote将某些请求转发到不同的代理服务器。 哪个请求去哪个服务器取决于许多因素(时间,负载,url,主机,用户…),并且必须由外部程序计算。 该过程目前通过向请求url的主机添加后缀,然后通过ProxyRemoteMatch指令进行匹配。 这是通过传递URL到一个重写映射。 这工作很好,但有贸易,我必须在configuration和DNS中定义EVERY服务器。 这是一个工作的例子: RewriteEngine on // define an external program that contains the logic where which request should be routed to RewriteMap balancemap prg:/home/mysite/balancemap.php <ProxyMatch "http://.*"> RewriteEngine on // if the route has not yet been set by suffix proxy pattern, pass the request uri and user to the mapping program and […]

使用ARR将TFS项目门户网站公开到互联网

我在www.evju.biz上有一个面向公众的web服务器,服务于多个页面(位于NAT防火墙的后面),另外还有另外一个托pipeTFS服务器的内部服务器“winttfs”。 我有指向www.evju.biz服务器的URL tfs.evju.biz。 当有人使用tfs.evju.biz时,我希望www.evju.biz服务器能够从wintfs服务器提供项目门户。 我已经安装并启用了应用程序请求路由caching。 在www.evju.biz网站下,我有以下规则: <rule name="tfs" stopProcessing="true"> <match url=".*tfs.evju.biz(.*)" /> <action type="Rewrite" url="http://wintfs{r:1}" logRewrittenUrl="true" /> </rule> 这个规则似乎并没有打到。 Hos应该设置它?

如何在Apache根级别阻止一些机器人和引用页面

当我使用Lighttpd时,可以通过这样的条目轻松实现。 所以所有的网站都受到保护 Wget机器人: $HTTP["useragent"] =~ "Wget" { $HTTP["url"] =~ "^/tagi(.*)" { # $HTTP["url"] =~ "" { url.access-deny = ( "" ) } $HTTP["url"] =~ "^/tags(.*)" { url.access-deny = ( "" ) } $HTTP["url"] =~ "^/kom.php(.*)" { url.access-deny = ( "" ) } $HTTP["querystring"] =~ "^(.*)strony(.*)" { url.access-deny = ( "" ) } $HTTP["querystring"] =~ "^(.*)page(.*)" […]

Apache Vhostredirect域然后页面

我试图重写域名,然后redirect到一个新的页面。 因此,project1.com,www.project1.com,project2.co.nz和www.project2.co.nz结束所有redirect到新域名http://newsite.com罚款。 但是我需要project1.com/2012去http://newsite.com/blog/archive ? 我已经从域重写规则删除L ,以允许它评估最后的重写规则…但没有喜悦? <VirtualHost *:80> ServerName project1.com ServerAlias www.project1.com project2.co.nz www.project2.co.nz Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTP_HOST} !^newsite\.com [NC] RewriteCond %{HTTP_HOST} !^$ RewriteRule ^/(.*) http://newsite.com/$1 [R=301] # project1.com/2012 needs to go to -> http://newsite.com/blog/archive RewriteRule ^(2012)$ https://newsite.com/blog/archive [R=301] </VirtualHost> 如果任何人都可以帮助,将不胜感激。

用Apache重写URL(与mod_proxy结合使用)

我正在使用Apache和mod_proxy通过HTTP提供对Monit GUI的访问。 到目前为止,我的configuration如下: ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPreserveHost on ProxyPass /monit http://localhost:2812/ ProxyPassReverse /monit http://localhost:2812/ 当人们去http://mywebsite/monit他们得到Monit主页。 然而,由Monit返回的链接有一个绝对path,它打破了仅适用于以/monit开头的path的代理。 我可以为http://monit.mywebsite (例如http://monit.mywebsite )创build一个单独的vhost来解决这个问题,但是想知道是否有另一个解决scheme。 问题1:有没有办法让Apache重写HTML代码中的链接,以便在ProxyPass和ProxyPassReverse指令中定义任何path? 问题2:如果上述不可能,你会看到另一个解决scheme,而不是我提到的单独的vhost ?

我怎样才能重写下面的URL在Nginx链接?

我怎样才能重写下面的链接在Nginx? http://www.example.com/filename/key.value/bar.foo 至 http://www.example.com/filename.php?key=value&bar=foo 请注意.php,请!