0

I'm trying to set up a Drupal installation to be able to have clean urls. I have searched for the .htaccess-file in the root-folder, but haven't found it. In the phpinfo-file I created, I see under Loaded Modules mod_rewrite, so it is enabled on the server. I created a .htaccess-file which contained a simple

RewriteEngine On

But when I ran the test under Configuration -> Search and metadata -> Clean URLs, it still failed. I then uploaded a .htaccess-file a friend sent me from a Drupal installation, but the test still failed.

What now?

4

1 回答 1

2

.htaccessfor Drupal单行复杂得多,我建议您下载 Drupal 的新副本并将文件.htaccess从根文件夹中取出并使用它。如果你找不到它,我建议打开隐藏文件,根据你的操作系统,有不同的方法可以做到这一点。

为了快速修复,添加这些行应该对您的问题进行排序:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
于 2013-02-21T11:13:32.020 回答