需要使用htaccess将php页面重定向到html吗?

需要使用htaccess将php页面重定向到html吗?,php,.htaccess,codeigniter,Php,.htaccess,Codeigniter,我已从此url读取htacess条件 但在htacess中,当条件被解决时,却不知道如何解决问题 我的主要问题是如何将所有php页面更改为html格式,在任何地方单击php链接,然后打开 就像示例一样:这个php url可以在任何地方打开,重定向到html页面,我在htacess中设置了什么条件 PHP Url 然后换成 我的情况如下 1) 这很好 RewriteRule ^([^/]+)/([^/]+)/?$ index.php?user=$1&type=$2 [NC,QSA]

我已从此url读取htacess条件

但在htacess中,当条件被解决时,却不知道如何解决问题

我的主要问题是如何将所有php页面更改为html格式,在任何地方单击php链接,然后打开

就像示例一样:这个php url可以在任何地方打开,重定向到html页面,我在htacess中设置了什么条件 PHP Url

然后换成

我的情况如下

1) 这很好

RewriteRule ^([^/]+)/([^/]+)/?$ index.php?user=$1&type=$2  [NC,QSA]
2) 但当我尝试此条件时,页面未打开

RewriteCond %{THE_REQUEST} \s/+.+?\.php\?user=([^\s&]+)&type=([^\s&]+)\s [NC]
RewriteRule . %1/%2.html? [R=301,L]
RewriteRule ^([^/]+)/([^./]+)/.html$ page.php?user=$1&type=$2 [NC,L,QSA]

.htaccess
中尝试此操作

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
.htaccess
文件:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
$config['index_page'] = ''; //specify your html file
.php
.html

RewriteEngine On
RewriteRule ^(.*)\.html$ $1.php [L]
RewriteCond %{THE_REQUEST} \ /(.+)\.php
RewriteRule ^ /%1.html [L,R=301]
config.php
文件:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
$config['index_page'] = ''; //specify your html file

页面未打开意味着什么?你有404错误吗?请进一步解释,您的问题目前还不清楚。@Starkeen如果URL来自网站和blogspotYes项目在CI中的任何位置,我如何使用htacess将php页面重定向到html页面。我是一些php的网址张贴到博客,现在我的网站是完全基于html的。如何使用htacessI将这些php URL更改为html页面我看到这一点但无法解决html和php页面都是打开的我希望一个页面仅在站点中打开html如果用户单击php文件,然后打开html页面另一个明智的html会自动打开products.php?product=Full-Body-Panel-Nokia-1208-Mobile-Phone-Housing-筋膜-Faceplate