简体   繁体   English

htaccess WordPress重写规则不起作用

[英]htaccess WordPress rewrite rules not working

I want everything that beginning with 我想要一切以
http://www.laurapeckauskiene.com/dt_gallery_category/ http://www.laurapeckauskiene.com/dt_gallery_category/
to be rewritten to 改写为
http://www.laurapeckauskiene.com/ http://www.laurapeckauskiene.com/
(dt_gallery_category is the archive) (dt_gallery_category是存档)

So I have in htaccess: 所以我在htaccess中:

# BEGIN WordPress
<IfModule mod_rewrite.c>
Options FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteRule ^dt\_gallery\_category.*$ http://www.laurapeckauskiene.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

But the requests are still not being redirected as wanted. 但是请求仍未按需要重定向。

Change 更改

RewriteRule ^dt\_gallery\_category.*$ http://www.laurapeckauskiene.com/

to

RewriteRule ^$ /dt_gallery_category/ [L]

You don't need to include the full URL since they're on the same domain. 您不需要包含完整的URL,因为它们位于同一域中。

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

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