简体   繁体   中英

How to do a htaccess modrewrite for redirecting a url?

Got an urgent issue, and I'm totally stumped.

We recently migrated a bunch of networked blogs, and realized one of them was using a subfolder structure, whereas all the new system is all subdomains. The wordpress multisite system doesn't allow for both subdomains and subfolder structures, so I'm guessing the logical solution would be to use htaccess to redirect requests for the old urls to the new url. But how do I write the code in the htaccess?

I need to make all requests to http://www.mysite.com/720/etcetc to http://blog.mysite.com/etcetc

Is this possible or is there another more viable solution?

Your assistance would be greatly greatly appreciated.

Thanks in advance.

My recommendation would be to install the Redirection plug-in on whatever site you have running at http://www.mysite.com/ and have it dynamically redirect all requests to /720/etcetc/* to the new address. Redirection can add the appropriate HTTP 301 headers and, since it's doing things dynamically, you won't need to hunt down each and every URL to write your .htaccess file.

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