.htaccess文件 - webhotel不支持AllowOverride

时间:2015-01-08 13:40:42

标签: php apache .htaccess

我遇到了问题因为我试图使用我的.htaccess文件进行一些URL重写。我是使用.htaccess文件的新手,所以我不知道这个问题的答案是否明显,但我昨天问过,我被告知我需要将Allowoveride设置为ALL才能使我的.htaccess文件正常工作。

问题是我的webhotel不支持用户访问根文件夹(低于域根目录(/domain.com/ HERE))

围绕.htaccess文件有办法将URL转换为友好吗?

我的代码如下(例如,域已更改)。

Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www\.domain\.dk$ [NC]

ErrorDocument 400 /?fejl=400

ErrorDocument 401 /?fejl=401

ErrorDocument 403 /?fejl=403

ErrorDocument 404 /?fejl=404

ErrorDocument 500 /?fejl=500

RewriteRule fag/(.*)/aflevering/(.*)/ index.php?fag=$1&id=$2
RewriteRule fag/(.*)/ index.php?fag=$1
RewriteRule aflevering/(.*)/ index.php?id=$2

0 个答案:

没有答案