Mobile app version of vmapp.org
Login or Join
Deb1703797

: I've changed my site's domain, created a redirect, but old URLs result in 404 I've changed the domain of my site, created a redirect, but it seems to work only partially. That is, when I

@Deb1703797

Posted in: #301Redirect #Domains #Htaccess

I've changed the domain of my site, created a redirect, but it seems to work only partially. That is, when I go to example.co.il (old) I do get to example.biz (new).

But when I go to example.co.il/just-a-nice-webpage-111 I get a 404?

Please tell me what can cause it, here is my domain.co.il folder htacess syntax:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^example.co.il$ [NC]
RewriteRule ^(.*)$ example.biz/ [R=301,L]

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Deb1703797

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sherry384

In order for this to work, you must retain the example.co.il domain and place the following redirect code in your .htaccess within the example.co.il web root.

RewriteEngine on
RewriteRule ^(.*)$ example.biz/ [L,R=301]


You do not need to check the host name.

If you make a request for a page that does not exist on domain.biz you will get a 404 error as you should. This is correct.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme