我想将页面(帖子)(domain.com/general/test /)重定向到(domain.com/general/test/2) >与 .htacces
并使用 ip 说我只想为ip xx.xx.xx人进行重定向。
** mycode但不起作用:( **
RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^xx\.xx\.xx\.xx$
RewriteRule ^test\ /test/2 [R,NC,L]
答案 0 :(得分:0)
尝试一下:
RewriteEngine On
RewriteCond %{REMOTE_ADDR} ^xx\.xx\.xx\.xx$
RewriteCond %{REQUEST_URI} !/general/test/2
RewriteRule ^general/test/ /general/test/2 [R,NC,L]
答案 1 :(得分:0)
@mohammed
RewriteEngine On
RewriteCond %{HTTP_HOST} example\.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://example.com/$1 [R,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
RewriteEngine On
#RewriteCond %{REMOTE_ADDR} ^xx\.xx\.xx\.xx$
RewriteCond %{REQUEST_URI} !/test/2
RewriteRule ^test/ /test/2 [R,NC,L]