Question
How to redirect a some files from a subdomain to corresponding files of a domain in Nginx?
I want to 301 redirect a bunch of files from a subdomain to another domain. This is my .htaccess file, can someone supply the code that works with nginx
RewriteEngine on
RewriteCond %{HTTP_HOST} ^media\.ahemahem\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.media\.ahemahem\.com$
RewriteRule ^(.*)$ "http\:\/\/www\.ahemahem\.com\/wp\-content\/uploads\/$1" [R=301,L]
and where should I add this code? I've set up a A record (media) for the domain (ahemahem.com) at digitalocean and I've set my main domain too. I've installed Wordpress on ahemahem.com using Easy Engine which works on Nginx.
Add a comment
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×