Articles of 重写

Mod_rewrite问题 – 这个文件的代码是做什么的?

我在这里研究.htaccess,并决定尝试我find的代码: RewriteRule ^([^\.]+)$ $1 [T=application/x-httpd-php-source] 这到底是做什么的? 我知道这是一个重写规则,但[T =]表示什么? 我知道R是redirect的,但是这对我来说是新的,所以知道这是什么是有用的。 另外,RewriteRule之后的regex符号表示什么? 我正在刷新我的知识,意识到我需要良好的.htaccess技能为我的项目! 我了解一些mod_rewrite和.htaccess并自己研究过,但这个是相当新的,所以所有的帮助表示赞赏。 谢谢

PHPMyAdmin 500内部服务器错误

我家的PHPMyAdmin在一两天前工作的很好。 现在它给了我一个通用的500内部服务器错误,并build议我看看我的服务器日志。 Apache日志包含这些错误消息: [Sun Feb 06 23:38:56 2011] [error] [client ::1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. 这是我卡住的地方。 有什么东西在创造一个无限循环,但是它可能是什么? 自PHPMyAdmin上次工作以来,我没有做任何事情(我能想到)。 我将在哪里遵循LimitInternalRecursion和LogLeveldebuggingbuild议…某种.htaccess文件? 我不知道在哪里可以find。 任何人都可以提供任何针对解决scheme或行动方针的指针? 编辑:感谢Alvosu我已经能够从重写日志中获得一些信息: ::1 – – [07/Feb/2011:09:19:48 –0800] [localhost/sid#10080d720][rid#1009854a8/initial] (3) [perdir /Library/WebServer/Documents/] […]

nginx重写目录和尾随/

在运行Squeeze(从Lenny升级)的Guruplug(ARM)上,我有一个奇怪的问题,我从来没有来过。 请求不带结尾斜杠的目录将URL重写为默认的server_name 这是我的server_name: server_name 10.10.10.1 192.168.*.* sheeva.domain.tld sheeva localhost; 每当我访问192.168.1.15 / mrtg我得到redirect到10.10.10.1/mrtg/,这取决于接口,并不总是工作,因为它应该是(IP无法访问)。 $ wget http://192.168.1.15/mrtg -O /dev/null –2011-02-09 22:17:51– http://192.168.1.15/mrtg Connecting to 192.168.1.15:80… connected. HTTP request sent, awaiting response… 301 Moved Permanently Location: http://10.10.10.1/mrtg/ [following] –2011-02-09 22:17:51– http://10.10.10.1/mrtg/ Connecting to 10.10.10.1:80… connected. HTTP request sent, awaiting response… 200 OK Length: 3742 (3.7K) [text/html] Saving to: […]

如何隐藏子文件夹使用Web.config的子域?

我有FTP访问我的ASP.NET Websapce(IIS 7),并且在Web根文件夹中使用Web.config路由子域。 她看起来像这样: <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <rewrite> <rules> <rule name="route www and emtpy requests" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{HTTP_HOST}" pattern="^(www.)?example.com" /> <add input="{PATH_INFO}" pattern="^/www/" negate="true" /> </conditions> <action type="Rewrite" url="\www\{R:0}" /> </rule> <rule name="route to blog" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{HTTP_HOST}" pattern="^blog.example.com$" /> <add […]

nginxredirect到一个子域,即使没有结尾的斜线

我只是在我的专用服务器上安装并部分configuration了nginx。 但是我对理解正则expression式有些困难。 我想让nginxredirectwww.mydomain.com/forum/和www.mydomain.com/forum(注意缺less的尾部斜杠;不区分大小写;同样适用于“forums”而不是“forum”)到forum.mydomain .COM /。 这就是我想到的: location ~* ^/(forum|forums) { rewrite ^/(.*)/(.*)$ http://forum.mydomain.com/$2? permanent; } …但由于某种原因,它只适用于斜线。 : – / 请帮帮我! 提前致谢!

微软networking农场2.0:如何让它与也有redirect的ASP MVC 3一起工作?

我得到的错误是: The virtual path 'null' maps to another application, which is not allowed. 我创build了一个MVC 3项目,并按原样发布。 关掉“URL重写”,一切工作正常。 把它重新打开,你会得到错误。 有任何想法吗?

为什么域/文件夹/和域/文件夹/////返回相同的位置?

为什么域/文件夹/和域/文件夹/////在浏览器的URL地址栏中返回相同的位置? Windows 7 + Firefox

如何在使用IIS 7维护子域时进行HTTPredirect

我的问题是类似的redirect子域到新域的子域,除了我使用的是IIS 7的应用程序是ASP.NET框架2.0。 我有一个urlcust1.olddomain.com,我需要redirect到cust1.newdomain.com。 我需要维护子域名,但我需要更改域名,以便用户永远不会看到olddomain.com,并且我拥有X个子域名。 我能够路由一切需要去使用DNS,但我不知道如何更改域,以便olddomain.com永远不会显示。 我希望能把这个301redirect,但是从目前我读到的内容来看,我认为这是不可能的。 思考?

在nginx中重写规则设置

我安装nginx 1.0.0,我安装了/usr/local/nginx1.0.0/。 我尝试修改/usr/local/nginx1.0.0/cont/nginx.conf文件。 我只是复制默认文件。 并replaceserver_name和根path 和我连接example.com – >它的工作(有Nginx的工作信息。) 但是我连接了www.example.com – >它不工作(404 Not Found消息。) url是= http://www.example.com/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/的index.php / index.php的/ index.php的/ index.php的/ index.php的/ index.php的/ index.php的/ index.php的/ index.php的/ index.php的/ index.php的/ index.php的/索引。 PHP / index.php的/ index.php的/ index.php的/ index.php的/ index.php的/ index.php的/ index.php的/ index.php的/ index.php的/ index.php的/ index.php的/ index.php的/ 我尝试server_name => example.com * .example.com(但同样的问题) 这是我的nginx.conf代码。 我错了configuration? 或错误的安装? server { listen 80; server_name .example.com; […]

使用Apache虚拟主机和不同的端口阻止对wp-admin和wp-login.php的访问

我有一个运行WordPress的站点,在监听端口80( www.example.com )的虚拟主机中定义。 我想阻止访问/ wp-admin和wp-login.php的用户,但是当他们查看不同的端口(如www.example.com:8080/wp-admin或www.example.com:8080/wp-login.php 我添加了一些RewriteRules来显示一个404错误页面,当他们点击80端口的站点,并创build一个新的虚拟主机,同样的网站,在端口8080监听,如下所示: <VirtualHost 192.168.3.20:80> Options -Indexes +FollowSymlinks RewriteEngine on RewriteRule ^/wp-login.php /wp-content/themes/404.html [R=404,NC] RewriteRule ^/wp-admin$ /wp-content/themes/404.html [R=404,NC] DocumentRoot /var/www/html/wordpress ServerName www.example.com </VirtualHost> <VirtualHost 192.168.3.20:8080> DocumentRoot /var/www/html/wordpress ServerName www.example.com </VirtualHost> 当访问/ wp-admin和wp-login.php时,它很好的显示错误404。 当通过www.example.com:8080/wp-admin或www.example.com:8080/wp-login.php访问时,它会按照预期显示login页面,但在input凭证并按Enter键继续之后,将显示我在80端口为虚拟主机声明的错误404页面,这是我不想要的,经过很多testing,我无法避免它。 有没有人有如何解决它的想法? 也许我正在尝试一个错误的方法呢?