I have a parked domain www.my-domain.com
I also have a hosted active domain sub.active-domain.com
I want to forward www.my-domain.com to sub.active-domain.com but keeps the url on
structure in the browser from sub.active-domain.com
example:
sub.active-domain.com/content/market.html
will shows on url become
www.my-domain.com/content/market.html
how to do it thru the htaccess file ? or should i do it thru the DNS or CNAME ?
The best way would be with .htaccess.
But you can not keep the url as long as you redirect it somewhere.
Or other wise use a iframe.
Related
I'm trying to load content hosted on a subdomain site as a subfolder on the same main domain - I've attempted a variety of IIS URL rewrites with no luck so far. The goal is for a user to go to:
domain.com/subdomain1
which displays
subdomain1.domain.com
but keeps the URL as
domain.com/subdomain1
There are multiple subdomains which I need to do this with.
I have the URL Rewrite module installed and have tried all many of rules.
Any help would be appreciated :-)
A rewrite changes the path on the server only, if you want the URL to change you need a redirect. You can change this on the rule.
Hi is it possible to stealth redirect a domain to another domain and in the meanwhile keeping the url of the first domain visible in the address bar?
Using cPanel and able to edit htaccess
I am not sure that this is possible, but you can instead do the following:
Use iframe in order to display the destination website inside your current website in "full screen". Read this for more information.
Point your domain name to the ip of the destination. This might not work if the destination uses virtual host, but you can try. Try using the same the sub-domain if this doesn't work.
I have a domain e.g. named www.example.com, when people type in example.com, it still can be accessed, but won't automatically add that 'www' to the url.
But as for website like facebook, if you type in facebook.com, it'll automatically add that 'www', BEFORE loading the page for you.
Probably I didn't explain it well, but guess you see the difference and get my point anyway.
So how can I make my domain acts like facebook, when people type example.com, it'll automatically add that www for them?
EDIT:
Ok, so I need a redirect to the 'www' subdomain. Actually I'm using nodejs, which hosted on Amazon EC2, to serve the webpage instead of Apache HTTP. So any equivalent of .htaccess in nodejs area?
I guess now the question shifts to more nodejs oriented, and it turns out it becomes a redundant of this thread:
Redirect all requests using Express 3?
Thanks all for your help.
you have to set your domain 301 permanent redirect in your control panel.
if your website is hosted in CPANEL then
GOTO -> Redirects in ( Domains Menu )
Choose the type Permanent (301)
choose your domain.com
www.domain.com in redirects to→ __
check the box on Redirect with or without www
finally CLick ADD
if your website is hosted in PLESK then
do it in your program level
or
plesk11.0.29 version above supports the 301 peramanent
You can do all of this with a .htaccess file.
https://kb.mediatemple.net/questions/242/How+do+I+redirect+my+site+using+a+.htaccess+file%3F
# This allows you to redirect your entire website to any other domain
Redirect 301 / http://mt-example.com/
Add this in a file named .htaccess on your host, but set it to the URL you want your main page to be.
To make a .htaccess file, you can always go in FTP, upload an empty .txt file, open it with notepad, put in the lines of code above, then rename it to .htaccess.
I currently have a WordPress Multi-Site Network set up. The main website is located at "http://safesideinc.com." Then, there is another sub-domain "http://danielgosek.safesideinc.com."
I want the URL "http://safesideinc.com" to lead to "http://safesideinc.com," and the URL "http://danielgosek.com" to lead to "http://danielgosek.safesideinc.com."
Using a 301 Redirect in .htaccess, I can achieve this. However, I would like it so that entering "http://danielgosek.com" in the URL bar leads to "http://danielgosek.safesideinc.com." WITHOUT CHANGING the URL displayed--in this case, the displayed URL should remain "http://danielgosek.com."
Are there any rules that could help me achieve this?
Not possible, a 301 - Permanent Redirect, is an instruction to the BROWSER that the resource has moved permanently and the BROWSER should re-direct to the provided new URL.
If you don't want the URL to change you either need a Reverse proxy set-up between the two virtual hosts / domains, or if danielgosek.com is just an alias, same IP and served from the same Apache virtual host, you could use an internal rewrite.
I have register a new domain name (example.com.sg) without hosting server, but my existing website (example.co.uk) has hosting server with all scripts, content, and database.
How to pin point my new domain name to current website in [example.co.uk]'s htaccess file?
Or any other way to redirect that page when visitor type the URL domain name (example.com.sg) in browser and goes to my website (example.so.uk) ?
I'm not sure what you're wanting to do, but if you don't have a hosting server for a domain, you will not be able to have a .htaccess file (since it would need to be hosted) and therefore would not be able to redirect in that fashion.
Like I said though, I don't really understand what you're asking.
However, a redirect from one domain to some other would look like this:
Redirect 301 / http://example.co.uk/
That would send all hits to the root directory to example.co.uk.
This is what domain parking do. Go to the cpanel of your example.co.uk site and select parked domains. Then park example.com.sg on example.co.uk