在httpd.conf使用重写在.htaccess而不是别名

编程入门 行业动态 更新时间:2024-10-20 07:38:07
本文介绍了在httpd.conf使用重写在.htaccess而不是别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

想设置了我自己编织的服务器共享的主机,显然我不能修改httpd.conf文件,所以我试图找到一个变通使用重写模块和.htaccess。

Trying to setup up my own Weave server on shared host, obviously I cannot modify httpd.conf file so I try to find a work-around using Rewrite module and .htaccess.

根据此文件 wiki.mozilla/Labs/编织/同步/ 1.1 /设置和的https://wiki.mozilla .ORG /实验室/纺织/用户/ 1.0 /设置我创建的的.htaccess 的

Based on documentation here wiki.mozilla/Labs/Weave/Sync/1.1/Setup and wiki.mozilla/Labs/Weave/User/1.0/Setup I created .htaccess

RewriteEngine on RewriteRule ^1.1(.*) server-sync/1.1/index.php/$1 [L] RewriteRule ^1.0(.*) server-sync/1.0/index.php/$1 [L] RewriteRule ^user/1.0(.*) weaveserver-registration/1.0/index.php/$1 [L] RewriteRule ^user/1(.*) weaveserver-registration/1.0/index.php/$1 [L]

而不是

but I could not get it worked. I always get Please enter a valid server URL when I setup "www.mydomain/dir/weave" as Sync URL in Firefox 4.

但我无法得到它的工作。我总是得到的请输入有效的服务器URL 的时候我的设置 www.mydomain/dir/weave 作为同步URL在Firefox 4。

are these Rewrite rules correct? if so I can prob weave-server config settings :/ Directory structure of my hosted scripts:

这些是重写规则是否正确?如果是的话,我可以概率织服务器配置设置:/ 我的主持脚本目录结构:

/home/myname/www/dir/weave/.htaccess /home/myname/www/dir/weave/server-sync > weave server scripts /home/myname/www/dir/weave/weaveserver-registration > weave server user scripts

推荐答案

我不知道怎么请求织文件,但我认为你可以测试这样的:

I did not know how weave requests file, but I think you can test this:

RewriteRule ^1.1(.*) dir/weave/server-sync/1.1/index.php$1 [L] RewriteRule ^1.0(.*) dir/weaveserver-sync/1.0/index.php$1 [L] RewriteRule ^user/1.0(.*) dir/weaveweaveserver-registration/1.0/index.php$1 [L] RewriteRule ^user/1(.*) dir/weaveweaveserver-registration/1.0/index.php$1 [L]

您的基本目录是 / = /家庭/ MYNAME / WWW / 您的规则应该重写请求 /1.0 以 DIR /编织/服务器同步/ 1.0 / index.php的$ 1 ,其中 $ 1 是什么,在那之后表示 /1.0 请求。 (注意去掉斜线!或者,你可能会增加一倍斜线结束)。

Your base directory being / = /home/myname/www/ your rules should rewrite request to /1.0 to dir/weave/server-sync/1.0/index.php$1 where $1 is anything that stands after /1.0 request. (Note the removed slash ! Or you may end with doubled slashes).

更多推荐

在httpd.conf使用重写在.htaccess而不是别名

本文发布于:2023-11-01 02:12:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1547948.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:别名   写在   而不是   httpd   conf

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!