簡體   English   中英

我無法使用.htaccess文件重定向

[英]I can not redirect with .htaccess file

我試圖將用戶在domainname /之后寫的任何東西重定向到index.php文件,但是除非我寫domainname / index.php / sdsdsdsd =>,否則它是行不通的,但是我想在不鍵入index.php的情況下進行操作。

這是.htaccess文件:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ /index.php

我改變時找到了解決方案

<Directory />
    AllowOverride None
    Require all denied
</Directory>

至:

<Directory />
    AllowOverride All
    Require all denied
</Directory>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM