Articles of 重写

nginx重写Joomla的规则!

我已经从版本库(v0.7.65)在Ubuntu上安装了nginx,虽然我的默认站点configuration使用WordPress漂亮的URL和nginx兼容性插件(到目前为止),但它并没有Joomla !. 这里是configuration: server { listen 80 default; server_name localhost; access_log /var/log/nginx/localhost.access.log; root /var/www/nginx-default; location /wordpress { try_files $uri $uri/ @wordpress; } location /joomla { try_files $uri $uri/ @joomla; } # Configuración para instalaciones de WordPress location @wordpress { fastcgi_pass 127.0.0.1:9120; fastcgi_param SCRIPT_FILENAME $document_root/wordpress/index.php; include fastcgi_params; } # Configuración para instalaciones de Joomla! location @joomla […]

需要IIS 6 URL重写帮助

我知道在IIS7中很容易,但不幸的是我在Windows Server 2003上运行IIS 6。任何人都可以给我一个简短的教训吗?

帮助nginx重写

在apache安装程序中,我掩盖了WordPress后面的WordPress /admin 。 我用下面的规则完成了这个工作: RewriteRule admin/(.*).php wordpress/wp-admin/$1.php [L] RewriteRule /admin$ admin/ [L,R=301] RewriteRule ^admin/$ wordpress/wp-admin/index.php [L] 所以nginx的最后一条规则很简单: rewrite ^/admin/$ /wordpress/wp-admin/index.php last; 或多或less的一个单词重复。 第二条规则似乎并不是必要的……它只是在那里最后强行斜线。 第一条规则似乎没有回升。 我有nginx的输出debugging信息的重写,它似乎没有写任何东西像urls /admin/edit.php 这里是我的整个nginxconfiguration,如果在那里会有一些信息块: worker_processes 1; events { worker_connections 1024; } error_log /var/log/file.log notice; http { rewrite_log on; include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; […]

在Nginx中掩盖一个url

我想转换一个url的格式 http:// foo.example.com:81/foo/s?id =(一个数字) 变成类似的东西 http:// www.example.com/foo/(a number)/ 在Nginx。 我已经尝试与proxy_pass并重写,但它不起作用。 我相信这很简单,但我不熟悉它。 谢谢。

Lighttpd:将任何请求redirect到index.html

我试图用lighttpd发送任何请求到index.html为了防止404,但我不够聪明,因为redirect匹配自己,或者对于调用subdirs,尽pipeindex.html得到服务,它是没有从文档根目录中提交,因此所有的path都closures,因此没有显示图像。 $HTTP["host"] == "my.example.com" { server.document-root = "/var/www/my/html/" # url.rewrite-once = ( "^/([^\./]+)/?([^\./]+)?(/|\.html)?$" => "/index.php?a=$1&b=$2" ) # url.rewrite-once = ( "^.+?" => "/" ) # url.redirect = ( ".*" => "http://my.example.com/index.html" ) # too many redirects }

MSDeploy删除IIS Url重写

我注意到,当我通过msdeploy部署我的应用程序时,所有的URL重写(IIS 7.5)都被删除。 我怎样才能防止这种情况发生,或者我怎样才能将url重写成msdeploy脚本的一部分?

nginx重写configuration

我对nginx相当陌生,并试图设置一些非常简单的重写规则,但他们似乎并没有工作。 只是为了您的信息,这台server { .. }有它的server_name domain.com *.domain.com 。 我有这个rewrite ^ /index.php?/$request_uri; 这似乎很好。 这将匹配domain.com/asd/sad/sad,一切正常。 不过,我想做一些有趣的子域名…所以我有s1.domain.com和s198.domain.com但我想改变我的重写,所以它去/index.php?/s1/$request_uri如果这是有道理的? 所以子域在$request_uri之前。 这是我迄今为止所尝试的: if ($host ~* ^([az]+)\..*) { rewrite ^(.*)$ /index.php?/$1/$request_uri; } rewrite ^ /index.php?/$request_uri; 真的很感谢您可以给的任何帮助! 谢谢。

Mod_rewrite不使用URL编码值

希望有人能帮助我,因为这让我疯狂。 我希望能够接受包含计算的URL,例如: http://www.calcatraz.com/api/calc/3*3.txt 并将其重写为这种格式: http://www.calcatraz.com/calculator/api.php?a=calc&c=3*3&f=.txt 当我使用这个重写规则时,上面的例子工作正常: <IfModule mod_rewrite.c> Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteRule ^api/calc/(.+)(\.(txt|sci))?$ calculator/api.php?a=calc&c=$1&f=$2 [L] </IfModule> 但是,包含特殊字符的url会被分解,url将被编码。 例如3/3将被要求使用: http://www.calcatraz.com/api/calc/3%2F3.txt 我想这样重写,像以前一样: http://www.calcatraz.com/calculator/api.php?a=calc&c=3%2F3&f=.txt 但它不 – 我只是得到一个对象没有find错误。 我已经玩了“B”旗和其他一些,但如果他们是正确的使用,我没有正确使用它们! 任何指针不胜感激!

如果省略了最后一个斜杠,则重写更改的URL

我有重写规则工作正常,但最终如果在去index.php时省略了尾部斜线,则更改可见的URL: RewriteEngine on RewriteCond %{REQUEST_URI} !main RewriteRule /.* /~user/main$0 当有人访问 http://user.dev.example.com/utilities/pib/ 该页面正常工作。 但是,如果他们访问 http://user.dev.example.com/utilities/pib 他们被redirect到 http://user.dev.example.com/~user/main/utilities/pib/ 这仍然可以正常工作,但我宁愿让url不要改变。 服务器有其他configuration,允许~user将您带到光盘上的public_html (这些文件所在的位置)。 所以实际的URL应该是: http://dev.example.com/~user/main/utilities/pib/ 但它仍然留下了我的名字在领域。 我不确定我是否能够解决这个问题,但是我也不确定其他configuration可能导致这个问题。

.htaccess 301redirectPLUS URL重写

前提: 我的摄影网站是www.domain.com,我的博客是在www.domain.com/blog上。 一切都在自我托pipe的WordPress平台上。 在我的索引页上,我有我的照片画廊。 我现在想用第三方服务在www.galleries.com/me上主持我的画廊。 我想实现的是: 当有人访问www.domain.com它被301redirect到www.galleries.com/me,但保持我的域在URL地址中可见 当有人访问www.domain.com/blog时,一切照常进行,没有任何变化。 我以为: 美国redirect规则加上我的.htaccess的重写规则 问题: 可能吗? 我该怎么做? 它如何影响search引擎优化? 我试图让它尽可能简单:)谢谢