Redirect domain to an URL - url

I own some domain website.com. Is there a way to redirect this domain to an URL 'test.com/test'?
I have tried to redirect via a script or .htaccess on a hosting, however, looking how to do it configuring the domain, without a hosting.

Related

HTTPS redirect when URL not prefaced with HTTP://

I have found numerous answers to redirecting HTTP requests to HTTPS but can't figure out how to redirect when the user only types the domain name without the protocol prefix.
Specifically....
The site is hosted on a Win2008r2 server with IIS7. One site in question is using .NET 2.0 and the other on the same server is 4.5. I'm successfully using the rewrite module so that HTTP ://www.Example.com redirects to HTTPS ://www.Example.com. However www.Example.com and Example.com both change to HTTP:// in the address bar but doesn't redirect.
Any suggestions?

Migration of URL schema between servers

I'm the sysadmin of a web site that is being migrated from a URL schema of plain HTML files to a dynamic Content Management System.
As example the old URLS are like www.example.com/books/somefolder/book31Chapter23.html and the new ones are like www.cms.example.com/x?book=31
The site is hosted in two servers, one 'old' serving the static old URLS at the main domain www.example.com and one 'new' with the CMS at a subdomain www.cms.example.com.
Web servers are nginx and the CMS is written in yii (PHP) but this shouldn't matter conceptually for this question.
There are many URLS and only part of the content has been migrated to the new CMS, so we have three cases:
user requesting old URL of content that hasn't been migrated: in
this case the web server (nginx) serves the content from the 'old'
server.
user requesting new URL (migrated content): this is served
directly by the new server
user requesting old URL of content that has been migrated: the
request reaches the old server. There's a mapping list and we have
nginx do a temporaty redirect from the old url to the new url, so
traffic is redirected to the CMS in the new server.
So far this has been working and as new content is migrated the redirect mapping list is updated.
The problem is that I'd like the second server with the CMS to serve content as the main domain example.com and not a subdomain cms.example.com , that and also the temporary redirects seem to affect SEO for Google etc.
Ideally I want in the 3rd case to do a permanent redirect to the new CMS URL schema without using a subdomain, noting also that currently the CMS is hosted in a different server (I could merge everything in one if needed). Also for the 2nd case users would go to the new URL using the naked domain and not a subdomain.
How do I achieve this in the current set up (using nginx redirects, DNS or whatever is needed)? is there a better set up for migrating urls between two servers?
thanks!

Domain Mapping in WPMU

I'm running WordPress MultiUser and a plugin to allow for domain mapping.
I have a subdomain site subdomain.domain.com
and I want domain2.com to point to it.
My tech buddy double checked my WP settings and said everything was good there.
When I go to my existing subdomain.domain.com site I am now redirected to domain.com registration page.
When I go to domain2.com I get the following:
The page isn't redirecting properly
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
Prior to the domain mapping attempt the sub.domain.com site worked fine
with sub.domain.com defined in Plesk as an alias of domain.com
I have domain2.com refined in Plesk as an alias of domain.com
I was told to have domain2.com made into an alias of sub.domain.com
but I don't see how to do that in Plesk.
Cloudflare is redirecting the domain2.com to the server correctly.
What am I missing?
It is probably best to contact CloudFlare so we can actually look at the zone file & then check any redirect rules on your server.
Just a quick note that mapped domains need to be added as individual domains, if not a subdomain of root domain, so that's why it is important for us to look at the zone file. If you're simply adding subdomains to a domain already added, then that is a different issue (WPMU plugin is also available through outside developer that only works for subdomains).

How do I associate a domain to a specific application url URL?

Suppose I own the domain mydomain.com and I have a web application on a server, at the URL http://99.99.99.99:1234/MyApplication/startpage.something
What I'd like to have is that if the user writes appserver.mydomain.com/ it goes to the application URL above, but the user still sees appserver.mydomain.com in the location bar (I used appserver instead of www to make the question more generic). I want also that if the user writes appserver.mydomain.com/app?q=120 it is like he typed http://99.99.99.99:1234/MyApplication/page?q=120, but the user still sees the URL as he typed it.
Until now (I'm using a cheap domain seller), I've been only able to have
http://appserver.mydomain.com:1234/MyApplication/startpage.something
or just http://appserver.mydomain.com but it remains only that in the url, even if there is a path or arguments in the URL.
I am mainly interested in Tomcat server, anyway any more generic istructions are welcome.
You can not do this. When a URL says http://something/, all browsers connect to port 80. To connect to port 1234, you must have it in the URL: http://something:1234/.
What you can do is:
create a URL redirect so that when a user connects to http://something/ (port 80), the request is redirected to http://something:1234/. You could do this using .htaccess redirect rules in the document root of your http://something/ site.
in the document root of the http://something:1234/ site, you could create a redirect rule that maps / to /MyApplication/startpage.something
With this solution, the user will see http://something:1234/ in the address bar. In case you need it, there are various resources on the web (and here on SO) on .htaccess redirects.

Redirecting subdomain for static assets on Heroku

I would like myapp.com/blog to redirect to www.myapp.com/blog. I've installed Refraction to do subdomain redirects at the Rack layer. That doesn't work on Heroku for /blog since my files in /blog are static assets. Any fix?
Sounds like you may be making this more difficult than it needs to be.
If you just want myapp.com/something to redirect to www.myapp.com/something, then goto the domain host that is currently handling the myapp.com domain and create a URL redirect record to do just that. This way, the redirect happens at the domain registrar before it even touches your Heroku server (which is how it should be handled).
An example of this would be to create the following records at your domain registrar (i.e. GoDaddy, NameCheap, etc): http://i.imgur.com/FJrMV.png
Those 3 IP addresses point to Heroku's servers. You should have already set up the custom domain add-on within Heroku if indeed you have some site similar to myapp.com and not myapp.heroku.com
Here's an article / video from Heroku that deals with a little bit of this as well: http://devcenter.heroku.com/articles/custom-domains

Resources