By alexmigf
Hi,
I’m facing a problem and i can’t figured out a solution.
I have an old website and domain in another server and i want to redirect all the pages to the new website and domain in DigitalOcean server.
To accomplish this i remove the old website and stablish the mod_rewrite redirects into htaccess.
The problem is, when i setup the redirects the memory and cpu of the destiny server (DigitalOcean new server) surge completely.
I have 3k URL redirects in the htaccess, here’s what i have in the file:
Options +FollowSymLinks RewriteEngine on
URL Redirect example RewriteRule ^old-site-url/ https://www.newdomain.com/new-url/ [L,R=301,NC]
I really need some help.
Thanks in advance Alex
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi,
It sounds like the very large amount of rewrite rules is causing this. If only the domain name has changed and the url structure is still the same, you can use the following rules instead to redirect to the new domain name:
RewriteCond %{HTTP_HOST} ^www.olddomain.com [NC,OR]
RewriteCond %{HTTP_HOST} ^olddomain.com [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301,NC]
Hi kamaln7,
Was a plugin conflict, i came up with a fix.
Anyway i made all the 3k redirects but not in .htaccess, instead i used Apache dbm in Vhost.
Thanks for your help anyway :)
Best Alex
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.