【发布时间】:2016-03-25 22:14:58
【问题描述】:
我一直在安装 Ushahidi 平台客户端。由于 mod rewrite,我得到了 API 的工作。现在我正在设置平台客户端,但我没有成功。
这是我的 html 文档设置:
html
index.html
about.html
平台客户端 服务器
www
.htaccess
index.html
这是我的平台客户端中的 .htaccess:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ /index.html [PT,L]
这里是平台客户端/服务器/www/index.html:
<!doctype html>
<html lang="en" ng-strict-di>
<head ng-controller="PageMetadata">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="/fonts/Lato/css/fonts.css" rel="stylesheet" type="text/css">
<!-- @todo minify CSS -->
<link rel="stylesheet" href="/css/style.css" ng-href="{{rtlEnabled ? '/css/rtl-style.css' : '/css/style.css'}}">
<link rel="stylesheet" href="/css/vendor.css">
<script src="/config.js"></script>
<title ng-bind-template="{{pageTitle}} {{siteTitle}}"></title>
<meta name="description" content="{{pageDescription}}">
<meta name="keywords" content="{{pageKeywords}}">
<meta name="robots" content="{{pageRobots}}">
<base href="/">
</head>
<body ng-class="{ rtl : rtlEnabled }" class="has-dynamic-header" canvas>
<div id="bootstrap-loading">
<header class="header header-full overlay" role="banner">
<div class="container">
<div class="color-overlay">
<div class="parallax">
<h1 class="beta"><i class="fa fa-refresh fa-4 fa-spin"></i></h1>
</div>
</div>
</div>
</header>
</div>
等等……
当我运行该站点时,我得到的是错误显示,而不是正确的显示。当我还检查元素时,我看到 /css/style.css 指向我的根目录,即域。
www.example.com/css/style.css
应该是:
www.example.com/platform-client/server/www/css/style.css
更新:这是我的 httpd.conf:
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName example.com
ServerAlias www.example.com
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@example.com
DocumentRoot /var/www/html/platform-client/server/www
ServerName example.com/platform-client/server/www
<Directory "/var/www/html/platform-client/server/www">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
我的设置有问题吗?我真的需要你的帮助,因为我已经修复了将近一个星期,但没有成功。我很乐意为您提供任何帮助。谢谢!
【问题讨论】:
-
假设您显示的 index.html 是 /platform-client/www/ 文件夹中的那个,您可以尝试在链接中删除前导斜杠:
-
@Gralgrathor 感谢您的回复。我试过没有用。仍然收到错误
-
那么导致错误的实际请求 URI 是什么?你在浏览器中输入什么来获取你列出的 index.html?
-
@Gralgrathor 我输入 www.example.com/platform-client/server/www 以查看 index.html
-
对,所以您的 docroot 就在您列出的文件夹结构的顶部。这意味着 应该指向相对于该 docroot 的位置。例如。 。或者我会这么认为。除非你的 .htaccess 中有更多的重写。
标签: php apache .htaccess ushahidi