Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess文件在Codeigniter应用程序中未正确重定向_.htaccess_Codeigniter_Mamp - Fatal编程技术网

.htaccess文件在Codeigniter应用程序中未正确重定向

.htaccess文件在Codeigniter应用程序中未正确重定向,.htaccess,codeigniter,mamp,.htaccess,Codeigniter,Mamp,我有一个应用程序使用MAMP在本地机器上运行,但无法重定向到live server上的某个页面。我已经将范围缩小到.htaccess文件,但似乎无法获得确切的配置。当我在基于Codeigniter的应用程序上注册一个用户时,就会发生这种情况,它应该重定向到另一个页面,但不会 这就是我现在拥有的 RewriteEngine on RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://website.com/$1 [R,L] # Hide

我有一个应用程序使用MAMP在本地机器上运行,但无法重定向到live server上的某个页面。我已经将范围缩小到.htaccess文件,但似乎无法获得确切的配置。当我在基于Codeigniter的应用程序上注册一个用户时,就会发生这种情况,它应该重定向到另一个页面,但不会

这就是我现在拥有的

RewriteEngine on
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://website.com/$1 [R,L]
# Hide all PHP files so none can be accessed by HTTP
RewriteRule (.*)\.php$ index.php?/$1

# If the file/dir is NOT real go to index
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
试着这样使用

RewriteEngine on   
RewriteCond %{HTTP_HOST} ^example.com [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301,NC]