的.htaccess未在Linux操作系统(Debian的)工作的Apache2 [英] .htaccess Is Not working in Linux(Debian) Apache2

查看:301
本文介绍了的.htaccess未在Linux操作系统(Debian的)工作的Apache2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的的Apache2 (我的虚拟服务器),这已经是我的 Debian的安装。每一件事情去罚款,但现在的问题我的的.htaccess

I am using apache2 (my dummy server) which is already install with my Debian. Every thing goes fine, but now the problem with my .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

它不工作结果
我想是因为的Apache2 的版本,我使用与放大器的;也许我的code什么的问题,我必须配置我的服务器上

It's not working
I think its because of apache2 version which am I using & maybe problems with my code or something I have to config on my server

我要的重定向我的网址主索引页如果一个输入错误或不可用

I want to redirect my url to main index page if its a wrong entry or unavailable

推荐答案

一整天的时光后,我得到了我的答案

After spending a whole day, I got my answer

在文件夹

的Apache2 >> 站点可用>>有文件名为默认

In Folder
apache2>>sites-available>> There is file called default

在默认情况下,我们必须改变它

In default we have to change it

从:

<Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

TO:

<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

其工作。它允许使用.htaccess文件。

Its working. It's enabled use of .htaccess files.

这篇关于的.htaccess未在Linux操作系统(Debian的)工作的Apache2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆