【发布时间】:2021-05-18 23:27:31
【问题描述】:
我想使用 .htaccess 重定向页面。我正在使用代码点火器 当用户在地址栏中输入此 URL 时:
form.bixy.com/salesapp
然后他们按下回车键,URL 应该变成:
form.bixy.com/salesapp/administrator/addusr
我在salesapp 文件夹中有这个.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|images|stylesheets|system/application/sources/)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/
</IfModule>
如果删除RewriteRule ^(.*)$ index.php?/ 行,我得到The requested URL was not found on this server.
我对 .htaccess 知之甚少。非常感谢任何帮助,在此先感谢。
编辑:
这是我当前放置在 inside salesapp 文件夹中的 .htaccess:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|images|stylesheets|system/application/sources/)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/?$ index.php [L]
RewriteRule ^/? /salesapp/administrator/addusr[NC,R=301,L]
</IfModule>
它仍然给我错误,但 URL 应该可以工作
The page isn’t redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
【问题讨论】:
标签: apache .htaccess codeigniter mod-rewrite url-rewriting