[ad_1]
I am new to coding and I’m trying to set up my htaccess file with conditional redirects. So that if the page it’s redirecting to turns up a 404 error, it will automatically redirect to another page that is up and live
Here’s the code I had generated, but I’m not sure if it’s right. I’m missing or where I could even find the code pre-made?
​
​
RewriteEngine On
RewriteCond %{HTTP\_HOST} \^example.com$
RewriteCond %{REQUEST\_URI} \^/old-url$
RewriteRule \^(.\*)$ \[R=301,L\] [ad_2]
