how to set premision for opening pages

#1
Hello,
i want have 1 site on 2 domains but , i wanna can open all links on domain1.com

and show just some links on

domain2.com


for example , there is site like google.com but when you wanna open gmail you have to use google.org/gmail

and other link with google.org will be unable to open or any error it can show !

how can i do this ? any rules on .htaccess
 
Last edited by a moderator:

Pong

Well-Known Member
Staff member
#2
You can use rewrite rules to do so , something with some rewrite conditions.

If you want to direct http://domain1.com/url1 to http://domain2.com/url1

at domain1.com doc_root .htaccess, add the following:

Code:
RewriteRule ^/url1$ http://domain2.com/url1 [R=301,L]
 
Last edited by a moderator:
#3
are you sure ? i did add this code : RewriteRule ^/url1$ http://domain2.com/url1 [R=301,L] on the top of .htaccess but it didnt work
 
Last edited by a moderator:
Top