How to properly redirect an http URL to a new https URL in WordPress on IIS8

时间:2016-02-12 20:04:27

标签: wordpress redirect mod-rewrite iis

I'm running WordPress on IIS8 and I'm having some 301 redirect issues. I have URL Rewrite enabled and it is working properly.

I'm using the Simple 301 Redirects plugin in WordPress, which works fine if I am redirecting an https URL to a different https URL. If I try to redirect an old http URL to its new (and differently named) https counterpart, however, I get a 404 error.

For example:

http://www.domain.com/MIG-Support => https://www.domain.com/dynamics-gp/dynamics-gp-support/

How do I resolve this? I do have access to the config file.

Thanks in advance!

Cynthia

1 个答案:

答案 0 :(得分:0)

Why not just do it manually (without a plugin) in your .htaccess?

Options +FollowSymlinks
RewriteEngine on
rewriterule ^old-url/(.*)$ http://yourdomain.com/new-URL$1 [r=301,nc]