如何重定向URL到一个新的URL使用.htaccess?



我想使用。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知之甚少。任何帮助都是非常感激的,提前感谢。

编辑:

这是我当前的。htaccess,我把放在里面salesapp文件夹:

<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.

salesapp中,你可以试试这个。htaccess:

RewriteEngine on
RewriteBase /salesapp/
RewriteRule ^(?:administrator)?/?$ administrator/addusr [R=301,L,NC]
RewriteCond $1 !^(index.php|images|stylesheets|system/application/sources/) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/?$ index.php  [L]

相关内容

  • 没有找到相关文章

最新更新