How can I forward a subdomain to another domain but follow all pages - .htaccess

I need to setup a sub domain to point to a certain part of another website, for example
Swindon.ukontheweb.co.uk to point to - http://ukontheweb.co.uk/location/england/wiltshire/swindon/
But I need the sub domain to follow all links not just a forwarding, so when you click a link on the Page it will show like this - Swindon.UKontheWeb.co.uk/ all pages of site
Baisically need the Subdomain to forward to new sites page but Subdomain to remain in Browser and follow links so Swindon.ukontheweb.co.uk/ anypage of new site.
I am new to this so I hope someone can help

You must have already created A record for subdomain in domain panel.
In your hosting panel, you simply have to point document root for your subdomain to the directry you mentioned.
It will not be forwarding but be working like you require.

Related

How do I redirect OldSite.com to NewSite.com/Sub/NewPage

I need to redirect several URLs to a new site that will have pages that replace the old sites. I don't care if the URL is masked or not. I just need the URL's to go to the new pages on the new combined site.
For example:
Oldsite.com redirects to NewSite.com/Sub/NewPage
Oldsite2.com redirects to NewSite.com/Sub/NewPage2
Oldsite3.com redirects to NewSite.com/Sub/NewPage3
and so on.
I've tried domain forwarding on the DNS level, but that isn't working (likely because of the subdirectories).
Problem is the New site was developed in Webflow and I don't have access to implement custom code for redirects.
My thought is to host a separate site to act as a hub that handles all the custom redirects to the New webflow site.
Any help or insight would be greatly appreciated.
Your scenario here isn't entirely clear on the types of redirections you're attempting to do.
If you're trying to redirect all paths from the old site to a specific destination page, like this...
oldsite.com/* ➜ newsite.com/sub/newpage
...many modern DNS providers support that.
If yours does not, you can switch your nameservers to Cloudflare DNS free edition, and you'll have the ability to define up to 3 page rules that support wildcard redirections like this.

Automatic subdomain creation and redirection

I would like to consult something in general. You can think of it like a portfolio site. Users will register on the site and they will be able to organize their portfolios as the subdomain of our project, for example, as username.domainaname.com. How can we serve the person's site as a subdomain. So how can we set these dns settings automatically? Thanks for your answers in advance. Can you recommend a source on this? I can give appect.com as an example site.
A possible solution is:
Provide DNS record * A 159.89.31.46 Thus all hosts with no explicit A record will be resolved to the IP address of your website.
2.In your web server configuration redirect requests to host username.appect.com to the approprate user's directory

How to redirect example.mydomain.com to folder.mydomain.com via DNS/.htaccess?

Is it somehow possible to redirect example.mydomain.com, a subdomain which does not actually exist, to folder.mydomain.com using either .htaccess or DNS? How can this be achieved?
When I access DNS from the control panel and click on the Web DNS tab, I see Personal web DNS settings, under which I believe I can submit domains and their values. However, I am confused with the type (web alias, web forward, A, CNAME, TXT, SRV, AAAA...). Could someone help me?
If the .htaccess way is simpler, I would then prefer it.
Thank you.
You wouldn't be able to use .htaccess as the subdomain does not exist.
I assume, from the process you described, that you are using One.com hosting. If so, the following guide will be of help:
Manage your DNS settings
Essentially, a web forward DNS entry will work for you:
Click on the Web DNS tab.
In the hostname/domain column, enter the subdomain you would like to redirect.
Set the type to web forward
Set the value to where you would like to be redirected when visiting the subdomain.
Click the (+) sign to save your changes.
It will take up to 90 minutes for your changes to take effect.

Same website on same domain name with different extensions - i.e. .com and .co.uk

What is best practice for doing this? Should I have duplicate content at each domain or should I redirect from one to the the other, i.e. all traffic to the .co.uk domain redirected to the .com domain?
Best practice is to send them all to one web server.
By default the server will not care which domain is pointed at it and will show the home page as domainx.com if you to it from domainx.com.
However there are two possible issues with this that come to mind:
The person who created the website hopefully only used relative links. (The contact us button points to contactus.htm instead of http://domainx.com/contactus.htm ) If not, some links might change the user from domainx.co.uk to domainx.com.
Search Engine Optimisation: Its better SEO wise if all the links to your site point to one domain name rather than appearing as several less popular sites.
You can get everyone on the same site by using a RewriteRule or 301 Redirect to the primary site. Or you can make every hyperlink on the site absolute and point to the primary domain.

htaccess stealth redirect domain A to domain B

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.

Resources