0

我无法从我的 URL 中删除文件扩展名

https://www.deemsolar.com/ar/index.php

这是我网站的当前 URL

我想将其更改为https://www.deemsolar.com/ar/

请帮帮我?

4

4 回答 4

3

将此添加到您的.htaccess文件中

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

注意:确保在config.php文件中,

$config['index_page'] = "";
$config['uri_protocol'] = "REQUEST_URI";
于 2019-02-14T11:39:20.640 回答
0

您可以使用以下方法删除:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
于 2019-02-14T11:24:22.133 回答
0

完整而清晰地阅读文档。 codeigniter url 文档

于 2019-02-14T11:34:13.987 回答
0
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

# For Index
RewriteRule ^index.extension?$ /index.php [NC,L]

# For Another Page
RewriteRule ^login.extension?$ /login.php [NC,L]
于 2019-02-14T11:36:36.263 回答