简体   繁体   中英

.htaccess rewriterule and wordpress

I have a wordpress page I'm trying to redirect to from the root directory. I can't use the traditional built in method of setting a wordpress page as the home page because of technical reasons caused by a plugin I'm using. So I'm trying to outsmart the plugin by using htaccess. Here is what I currently am trying in my .htaccess file

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^$ /?grp_pages=4 [NC]

It's throwing an Internal Server Error. I think this is hiding wordpress' index.php file from itself and causing the error?

You need to check that the query string isn't already set:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} !^grp_pages=
RewriteRule ^$ /?grp_pages=4 [NC]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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