Apache .htaccess重写-重定向页面

Apache .htaccess重写-重定向页面,apache,.htaccess,mod-rewrite,redirect,rewrite,Apache,.htaccess,Mod Rewrite,Redirect,Rewrite,我想知道如何重定向访问以下地址的所有访客: 到 它无法重定向已经处于状态的人员以避免循环。这是我当前的.htaccess: Options -Indexes +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTPS} off RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{REQUEST_FILENAME} !-d

我想知道如何重定向访问以下地址的所有访客:

它无法重定向已经处于状态的人员以避免循环。这是我当前的.htaccess:

Options -Indexes +FollowSymLinks

RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f 

<IfModule mod_php5.c>  
    RewriteRule ^(.*)$ index.php/$1 [L]    
</IfModule>    

# the following is for rewritting under FastCGI
<IfModule !mod_php5.c>    
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
选项-索引+FollowSymLinks
重新启动发动机
重写基/
重写条件%{HTTPS}关闭
重写规则。*https://%{HTTP_HOST}%{REQUEST_URI}[L,R=301]
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^(.*)$index.php/$1[L]
#以下是在FastCGI下重写的内容
重写规则^(.*)$index.php?/$1[L]

谢谢

您可以在
文档\u ROOT/.htaccess
文件中使用此代码:

Options -Indexes +FollowSymLinks    
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{THE_REQUEST} !/search/ [NC]
RewriteRule ^(.*)$ search/$1 [L,R]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f 

<IfModule mod_php5.c>  
    RewriteRule ^(.*)$ index.php/$1 [L]    
</IfModule>    

# the following is for rewritting under FastCGI
<IfModule !mod_php5.c>    
    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
选项-索引+FollowSymLinks
重新启动发动机
重写基/
重写条件%{HTTPS}关闭
重写规则^https://%{HTTP_HOST}%{REQUEST_URI}[L,R=301]
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写cond%{THE_REQUEST}/搜索/[NC]
重写规则^(.*)$search/$1[L,R]
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^(.*)$index.php/$1[L]
#以下是在FastCGI下重写的内容
重写规则^(.*)$index.php?/$1[L]

您好,谢谢您的回答,但返回错误500。我以前使用的是.htaccess,我更新了上面的问题,提供了更多详细信息。效果很好!非常感谢你!