简体   繁体   中英

redirect url in wordpress wp-admin dashboard via htaccess

I've been trying to redirect a url in my wordpress wp-admin dashboard from /wp-admin/admin.php?page=for_buyers to wp-admin/for-buyers/ .

Is there any way to correctly do this? I've tried modifiying my .htaccess file as can be seen below, but it's not working.

# 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]
RewriteRule ^wp-admin/for-buyers/$ /wp-admin/admin.php?page=for_buyers
</IfModule>
# END WordPress

UPDATE: I have been able to do it, but it now causes a redirect loop.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^/wp-admin/admin.php?page=for_buyers wp-admin/for-buyers/$
</IfModule>

You do not need to redirect your url but just rewrite it .

Take a look here

Hope this helps you!

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