简体   繁体   English

重定向除主页之外的所有页面

[英]redirect all page except homepage

i want to htaccess redirect all pages to folder called (wp-simply) except home page or / will not redirect , will open the same home page i have searched a lot but get nothing working 我想htaccess将所有页面重定向到名为(wp-simply)的文件夹,除了主页或/不会重定向,将打开我搜索过的相同主页但没有任何工作

i do this now 我现在这样做

RewriteEngine on

RewriteBase /
RewriteCond %{REQUEST_URI} !^wp-simply
RewriteRule ^(.*)$ /wp-simply/$1  [L,R=301]

it redirect all that do not have wp-simply to wp-simply and also redirect the home page to wp-simply i want it to redirect all except the home page 它将所有没有wp的方法重定向到wp-simply并将主页重定向到wp-我希望它重定向除主页之外的所有内容

To exclude the homepage, you can put the following condition above your RewriteRule 要排除主页,可以将以下条件置于RewriteRule之上

RewriteCond %{REQUEST_URI} !^$

or change your regex pattern to ^(.+)$ to force at least on character in the uri. 或者将你的正则表达式模式更改为^(。+)$以至少强制uri中的字符。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM