≈ the.bay.news

using .htaccess to manage two domains pointing to one website?

programming.dev
using .htaccess to manage two domains pointing to one website?
Hey all, rookie dev here! I want to set up a website example.net [http://example.net] which holds all my projects, but I’d also like to have a domain www.project.test which actually points to a single file on my example.net [http://example.net]: example.net/project.html [http://example.net/project.html] I’d also like for project.test/* to return an error at project.test/404 while example.net/* [http://example.net/*] works normally. basically project.test should be a url specifically for one (or a subset of) html files which live on example.net [http://example.net]. I figured that I can probably achieve this with the .htaccess file on the shared hosting, apache server my website is on. However the copy/pasteable rules I find online don’t exactly fit my needs. I have already set up both domains to point to my website, now I’m kind of stuck… (I only know html/css and some vanilla js at this point) Could someone point me to useful (possibly beginner friendly) resources, where I could learn to create my own .htaccess rules / where the syntax is explained in detail? Do you have tips on how to approach this idea? Any help appreciated!

Hey all, rookie dev here! I want to set up a website example.net [http://example.net] which holds all my projects, but I’d also like to have a domain www.project.test which…

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.