0

I was trying to setup Lithium Php framework. I followed the documentation for getting started. I have done this: *"make sure mod_rewrite is enabled, and the AllowOverride directive is set to 'All' on the necessary directories involved. Be sure to restart the server before checking things."* Rewrite module is enabled. Verified by

apache2ctl -M

I have changed the AllowOverride in /etc/apache2/sites-available/default file. Now when I go to http://localhost/LithiumTestApp/, the page loads but sans css, js, images etc as the links do not work. I can't seem to find what I have done wrong.

I'm running Apache2 on Ubuntu 11.10.

Edit: Contents of .htaccess are:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$   webroot/   [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>

Part of Lithium Framework itself. I haven't changed anything here.

4

1 回答 1

0

我建议首先检查您的重写是否正常工作。我通常在我的 vhost 文件中设置一个重写日志路径(或者在你的 httpd.conf 或 apache2.conf 中设置它,无论你的操作系统使用哪个)。

RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 5

然后做:

tail -f /var/log/apache2/rewrite.log

这将允许您在日志内容发生时查看日志内容并刷新页面并查看一切是否正常。我还建议查看您的 Apache 错误日志以查看请求中是否存在错误。

另外,请确保您的资源文件夹具有写入权限。

于 2012-05-30T07:19:28.257 回答