htaccess code

Adult Link Chaser

Regular Member
Joined
Oct 19, 2021
Messages
222
Reaction score
186
I changed my domain and i want to redirect my entire old domain to the new domain with the same folders just a change domain name

how do i redirect

cars.com/red/blue/green

to

cars.com.au/red/blue/green
 
yeah, you need to redirect each URL individually... or maybe if someone knows a code to redirect everything that will work too.

But if you only have 100+ URLs you can do it manually, it will take you 10-15 minutes :)
 
try this
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourolddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.yourolddomain.com$
RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]
</IfModule>
Put the code on your old domain, this will redirect all the website to the new domain , if you want to redirect one single page let me know
 
This will work perfectly

# Wildcard Redirect from xyz.com to abc.com with variations handling

RewriteCond %{HTTP_HOST} ^(www\.)?xyz\.com$ [NC]
RewriteRule ^(.*)$ https://www.abc.com/$1 [R=301,L]


it will redirect all variations in a Single Hop to the destination, whether it, is www, non-www, https or HTTP, Alternatively, you can ask ChatGPT for the CODE.:)
 
The person above wrote you correctly, but you don't need the HOST directive, you are redirecting all the traffic, so, one line at a time:

RewriteRule ^(.*)$ https://cars.com.au%{REQUEST_URI} [NE,END,R=301]
 
Back
Top