How to create subdomain inside subdomain in cpanel? - subdomain

What I need to do to use subdomain inside another subdomain?
Example:
I have domain.com and I want to use site.domain.com for creating subdomains under it (user1.site.domain.com, user2.site.domain.com, user3.site.domain.com).

I did find myself the way to do that.
1) I did create on cpanel the "site" subdomain redirecting to "public_html/"
2) I did create on cpanel the "*" subdomain redirecting to "public_html/"
That's it!

Related

How do you use redirects (either a _redirects or toml file) in Netlify to redirect from a custom domain alias URL to a primary domain file path?

In my directory I have a _redirect file that contains the following:
https://revivifygame.com /revivify
According to the netlify docs, this should redirect revivifygame.com ---> itsmo.co.uk/revivify.
I own both domains mentioned above.
However, after deployment, the redirect is not working. Any help on what could be going wrong?

make public website reconnect to local html or xampp

Basically what I want to do is if I open this
http://steamcommunity.com/market
website on my pc I want to see a local website that is stored as html. I already tried to host the website with xampp which worked and trying to add
localhost/path http://steamcommunity.com/market
to my hosts file.
but instead of redirecting me to my local hosted html file it just loaded the steam market.
This is a two step process: first, you have to redirect the web site name to your computer; next, you get Apache to redirect the web site address to your installed directory.
Locate your hosts file,
Add lines containing the domain name(s) and IP address to redirect to.
Each line must begin with the address 127.0.0.1 (this is the localhost address)
After the IP address, type the name of the domain you wish to redirect to this address. You may only enter 1 name per line.
Addresses like my-site.com and www.my-site.com are different and each need a separate line.
Save the changes.
Next,
Locate the httpd-vhosts.conf file. For most XAMPP 1.7.3 installs this will be C:\xampp\apache\conf\extra
Add the new host,
<VirtualHost *:80>
ServerName www.joomla.16
ServerAlias joomla.16
DocumentRoot d:/xampp/htdocs/path/mysite
</VirtualHost>
Explanation of VirtualHost preparation,
ServerName: following this label, add the name of the domain you added in
ServerAlias: following this label, you may add as many alternate domains (separated by spaces) as you like that are supposed to resolve to this virtual host. Remember that www.my-domain.com is different from my-domain.com, but, typically, you would want them to resolve to the same server.
DocumentRoot: following this label, add the path where your website is located. You can use an absolute path (as in the example above), or a relative path (but relative paths can be trickier to set up, so I prefer to use an absolute path).
Restart Apache Web Server
You should now be able to type the domain name into your URL field and go directly to your locally hosted web site:
Please see this tutorial for more help.
No idea why you'd wanna do this, but your hostsfile should be:
127.0.0.1 www.steamcommcunity.com
::1 www.steamcommcunity.com
127.0.0.1 steamcommunity.com
::1 steamcommunity.com
Just to be on the safe side I've used both with and without www, and both IPv4 and IPv6

Can I access files from a subdomain into a parent domain?

I created a subdomain inside the folder subdomain, when trying to read css from the parent directory (root) it is not working.
Is there some fix to this?
You'd have to specifiy the full path to the resource on the subdomain ( such as: 'http://subdomain.example.com/styles.css') since the root path will only point to the domain the site is hosted on.

Handle subdomains with Yii2 (LAMP)

I'm developing using php and Yii2, apache2 and ubuntu.
So we have domain such as domain.com (as an example). Now I need create some pages as page1.domain.com as landings, but they will be created automatically?
How should I setup vhost for this one? I don't know what subdomain name will be (can be any a-Z0-9). Should I create new vhost and enable it or I can somehow enable it on existing one?
Next problem is URL on page1.domain.com When we open page1.domain.com all links are like "http://page1.domain.com/xxx" but I need "http://domain.com/xxx"
So main thing is to change base url no matter what domain but reacts on it's subdomain if exist.
Two things there:
1) Active subdomain wildcard
In your vhosts config file, add:
ServerAlias *.example.com
Then you have to add an entry in your DNS. For localhost, you can't add it directly in your hosts file:
https://serverfault.com/questions/319518/add-wildcard-subdomains-to-localhost-with-apache
2) Create the rules
You could add a pattern in your url manager to match the subdomains to a controller handler.
'http://(\d+).domain.com/' => 'controller/index',
More info:
[1] http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html#rules-with-server-names
[2] http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html

Photos are not showing up when using No-IP ddns and linux apache

I don't have a static IP address so a person recommended that I use no-ip.com
I did and now my website is accessible from external internet yay
The problem now is that my photos aren't showing, I thought this would have been a simple issue
I'm not sure if I have to do something with Virtual Host or...
My domain name is greenace92.ddns.net
I can access my index.html file, that shows up fine but the photos aren't showing
On my httpd.conf file I have
ServerRoot "/usr/local/apache2"
The html files are in htdocs under apache2
So, on virtual host that httpd-vhosts.conf file I have the following
ServerAdmin "jacobcun#ricekidengineer.com"
DocumentRoot "/usr/local/apache2/"
ServerName "www.greenace92.ddns.net"
*ricekidengineer.com is my other domain with email configured
I didn't change the error logs from stuck "dummy" stuff
So on my html file for image href's I have
http://www.greenace92.ddns.net/htdocs/images/normalbus-icon-on.png
I assume that www.greenace92.ddns.net is /usr/local/apache2
So I'm just continuing the directory location
Is that correct? What is wrong?
Yeah I don't understand, I even tried three different directories for a few photos, trying directly in apache2, then htdocs, then the images folder
What am I not seeing?
You will have to decide what your want as the domain for your site:
www.greenace92.ddns.net is not setup for your web site
greenace92.ddns.net is the domain setup for your web site.
You either have to
configure no-ip.com to point to the domain www.greenace92.ddns.net
(or)
change your apache ServerName directive to
ServerName "greenace92.ddns.net"
and change the image URLs in your HTML pages from something like
http://www.greenace92.ddns.net/htdocs/images/normalbus-icon-on.png
to
http://greenace92.ddns.net/images/normalbus-icon-on.png
Note: With your current configuration, the 2nd URL mentioned above should already work (It worked when I tested!).