I'm trying to redirect a certain url (actually I have several hundred) to another URL with the following code, but it's not working. The htaccess is in my wordpress root directory, where the wp-content files etc are. What am I doing wrong?
# 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
Options +FollowSymLinks
RewriteEngine On
Redirect http://lifeandhealth.org/qr/049ow34gh9klhg3uqrf2 http://lifeandhealth.org/?p=58
#BEGIN WordPress
). If that doesn't work, I'm uncertain if this will, but try to be as explicit as possible.
Redirect 301 /qr/049ow34gh9klhg3uqrf2 http://lifeandhealth.org/?p=58
Change the 301 to 302 if the redirect is temporary.
This isn't exactly WordPress-specific functionality, so look this is a good resource for more advanced redirects.
If that doesn't work, let me know in comments, and I'll try to updated with another (attempted) solution :)
Some other things to keep in mind
Two tweaks:
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^() index.php [L]
/
in front of index
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.