I have my website and I want it to be online for customers.
In the mean time I want to upload wordpress to the same domain and start configuring it, but without anyone seeing that.
My website has a simple structure (index.php, about.php, contact.php) and if I upload new WP it will overwrite my old index.php.
Is there anyway I can make it work? Sb goes www.mywebsite.com and is being redirected for example on www.mywebsite.com/old/index.php?
And only from my IP (static) I have normal access to www.mywebsite.com to get the configuration done?
(Assuming your using apache)
Use a new VirtualHost (http://httpd.apache.org/docs/current/vhosts/examples.html)
<VirtualHost *:80>
DocumentRoot /www/example1
ServerName www.example.com
# Other directives here
</VirtualHost>
if you want both to be assiible from the same domain at the same time, you will need either a subdomain or a change of port, Both are doable with the above block of code.
You will need to either reload or restart apache for the changes to take place
Related
Let's suppose there is a webpage where someone can create his own profile page.
His profile page is then available at
domain.com/some-user
Then, this user with profile domain.com/some-user, own his own domain
someuser.com
and he wants redirect from someuser.com -> domain.com/some-user
How can this be achieved?
I mean what DNS records must be set for someuser.com, and what web-server settings must be set on domain.com
Thanks
One possible solution is to redirect him to domain.com host, and via apache, redirect him to domain.com/some-user.
You can do it in several technologies as Java, Php, Ruby, Node, since it's a http header field (host), which you can read and do the processing that you want.
For instance, using apache configured to answer for someuser.com and .htaccess files it would be:
Redirect "/" "http://domain.com/some-user/"
I have a bunch of domains (50+), e.g. example1.org example2.org, example3.org that I would like to redirect (301) to a single domain, examplethebest.org. Nothing is hosted on any of these domains other than examplethebest.
I've set up all the example domains in the registrar's DNS to point to the IP of my web server.
I was wondering if redirecting these is something I could achieve via rewrites in the applicationHost.config file. Or do I need to add bindings for example1 - example3.org in examplethebest's website bindings?
Just wanted to add that I understand how to do the rewrites via the web.config in examplethebest if I add bindings for the domains I want to redirect, but would rather not have loads of domain bindings - e.g. what is best practice here? Thanks!
Okay so the issue I had on this particular web server was that the default website (listening to all requests on port 80) was stopped - the other websites all had specific bindings.
At least two possible solutions for this one:
Starting the default website and adding {http_host} rewrites in there
Creating another website, make it listen to all requests on port 80 with just a web.config and putting the {http_host} rewrites in there.
We went with option 2.
I have two domains that are both hosted on the same server. Therefore, they both have the same index.html page, and they share all of the other pages. This means that there are two ways to access every file stored on the server:
domain1/file
And
domain2/file
Is there a way to redirect the user to the respective domain1 URL whenever they go to a domain2 URL? The catch is that I only want to redirect if a domain2 URL is gone to.
How can I achieve this programmatically?
Just because you have two domains running on one server does not mean they have to share index.html. The way around this is by using Virtual Hosts. You didn't mention which web server type you are using, so I'll give you an apache example:
<VirtualHost *:80>
DocumentRoot /www/example1
ServerName www.example.com
# Other directives here
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /www/example2
ServerName www.example.org
# Other directives here
</VirtualHost>
This allows you to have two directories, each serving as a root path for each domain. You'd put the domain1 files in /www/example1, and the domain2 files in /www/example2, in this example. There are some other configuration options you may need, but again depending on your setup, they could vary greatly.
If you are using IIS, there's a writeup over on Server Fault that has information on how to perform that. (This question probably belongs there anyway).
In my DNS provider I set to redirect the naked domain:
http://mydomain.com to http://www.otherdomain.com/index.html
Redirect works, however I need to pass the path also to index.html to whatever means, what could be the solution?
Example:
Pass the path 'abc' to index.html
http://mydomain.com/abc
The abc will be passed into the index.html hosted in otherdomain.com, how can this be done? Or the path during a redirect is lost in translation already?
Update:
As per my understanding DNS providers usually does this through pointing the naked domain into a site where it will do the 301 redirect, where it should still have the path and subfolder in the original request, I'm not really sure.
DNS simply resolves the domain name to an IP. If the domain name requested by the browser is on the web server then the web server will return whichever file is appropriate for the request. An example would be a VHOST in Apache. The DNS server doesn't look up anything relating to the actual files on the URL itself other than the domain name.
To handle this with Apache you might setup the server like this:
<VirtualHost *:80>
ServerName mydomain.com
ServerAlias otherdomain.com
Redirect / http://www.otherdomain.com/
</VirtualHost>
I have a domain in which I want the subdirectory to be shown as a subdomain in the url.
I do not want it to be a subdomain because it'll cause problems with the integration of two cms's that I have.
I would like
forum.domain.com -> domain.com/forum
to redirect to there but I would also like it to keep saying forum.domain.com in the url and not change to /forum.
I do have access to the DNS zones but I am completely lost on how to do this. So far my forum.domain.com is a website by itself in which I do not want it to be.
*Server Htaccess is running helicon ape.
This cannot be done purely through DNS. It's not hard, but it does involve your web server's configuration.
In DNS, create a CNAME (an alias) for forum.domain.com to point to your server, probably domain.com.
In your webserver's configuration, configure a new virtual host with that path as its document home. The way you do this will depend on whether you use Apache, Nginx, etc.