質問

I want to change my URL totally, for example I have a URL like this:

www.myurl.org

I require:

www.change.com  

Whenever anyone open:

www.myurl.org

Then open my site and change URL in URL bar, How can I do that?

Edit: I do not want the user to be redirected to that site. I want the url in the address bar to be changed to www.change.com while the user is actually on www.myurl.org.

役に立ちましたか?

解決 2

Any hostname that is directed to your app will be re-written to use change.com. The RewriteCond allows requests to change.com to pass through, and and the RewriteRule rewrites all other URLs.

RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.)?change.com$ [NC]
RewriteRule ^(.*)$ http://www.change.com/$1 [L,R]

Oh course, you must have mod_rewrite enabled. And It may or may not be allowed in .htaccess files depending on your Apache Configuration.

Here is the Apache Documentation on the topic.

他のヒント

Here is your answer: Please believe me.(-;

You can't do it in internet. Maybe you can do it on your local network.

Please think if it was possible. Then how we could trust internet and websites?

You could use a good old iframe

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top