1

Suppose I redirect exmpale0.com to example1.com , example1.com is newer. Already , I promoted my exmpale0.com into social networks , Suppose I had:

http://example0.com/blahblah

Now I have

‍http://exmpale1.com/blahblah‍

When I use http://example0.com, It can redirect to example1.com but I need to every URL what I promote into internet work fine,

Question is, Do you have any redirect solution for all of subURL?

1 Answer 1

3

You want to do a blanket redirect from one domain to another.

Assuming Apache, put in your .htaccess file in the root directory of example0.com:

RewriteEngine on
RewriteRule ^(.*)$ http://www.example1.com/$1 [L,R=301]

This will redirect all requests from 0 to 1 and keep the original request URI.

2
  • I added your code to .htaccess and when i request http://example0.com/%D8%AD%D9%84-%D9%85%D8%B4%DA%A9%D9%84-briefly-unavailable-for-scheduled-maintenance-check-back-in-a-minute-%D8%AF%D8%B1-%D9%88%D8%B1%D8%AF%D9%BE%D8%B1%D8%B3/ I get the following error : The requested URL /index.php was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. Aug 27, 2015 at 9:33
  • Oh thnk you , I eliminated my some code in .htaccess file. Aug 27, 2015 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.