我已經在電腦上安裝了 Ubuntu 和 XAMPP,但是當我啟動 Web 伺服器並轉到 htt://localhost/webname(webname 是 htdocs 中的資料夾名稱)時,我收到錯誤 403。
webname 裡面的 .htaccess 如下:
# Created on: 03/01/2012
# Author: **********
# Redirect every request to index.php
RewriteEngine on
RewriteBase /
RewriteRule ^$ /webname/public/index.php
RewriteRule ^about/?$ /webname/public/about.php
RewriteRule ^changelog/?$ /webname/public/changelog.php
RewriteRule ^home/?$ /webname/public/home.php
RewriteRule ^friends/?$ /webname/public/friends.php
RewriteRule ^(\w+)/?$ /webname/public/home.php?user=$1
RewriteRule ^login/?$ /webname/public/index.php?show=login
RewriteRule ^signup/?$ /webname/public/index.php?show=signup
RewriteRule ^profile/(\w+)/?$ /webname/public/profile.php?user=$1
# Rewrite www.webname.com -> webname.com
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# Disable directory listing for all the subdirectories
Options -Indexes
在 Windows 上一切正常,但在 Ubuntu 上我不斷收到此錯誤。
謝謝你的幫忙。
答案1
這是權限問題。我只需要改變它們就可以解決這個問題。