问题描述
||
尝试在共享主机上设置自己的weave服务器时,很明显我无法修改httpd.conf文件,因此我尝试使用重写模块和.htaccess找到解决方法。
根据此处的文档https://wiki.mozilla.org/Labs/weave/Sync/1.1/Setup和https://wiki.mozilla.org/Labs/weave/User/1.0/Setup我创建了.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]
代替
Alias /1.0 <full path to weave directory>/server-sync/1.1/index.PHP
Alias /1.1 <full path to weave directory>/server-sync/1.1/index.PHP
Alias /user/1.0 <full path to weave directory>/weaveserver-registration/1.0/index.PHP
Alias /user/1 <full path to weave directory>/weaveserver-registration/1.0/index.PHP
但我无法使它工作。我总是得到当我在Firefox 4中将\“ http://www.mydomain.com/dir/weave \”设置为“同步URL”时,请输入有效的服务器URL。
这些重写规则正确吗?如果是这样,我可以尝试编织服务器配置设置:/
我的托管脚本的目录结构:
/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
解决方法
我不知道如何编织请求文件,但我认为您可以对此进行测试:
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]
您的基本目录是/ = /home/myname/www/
,您的规则应将请求重写为/1.0
到dir/weave/server-sync/1.0/index.php$1
,其中$1
是/1.0
请求之后的任何内容。 (请注意已删除的斜杠!否则,您可能会以双斜杠结尾)。