Alias subdirectory as a subdomain on root domain

I have the following structure:

example.com (Root), app.example.com (actual application)

Users can access their profile as: app.example.com/view/username for example

Is there a way I can show the content of app.example.com/view/username in username.example.com directly?

I tried creating a wildcard subdomain but it doesn’t seem to work as right now I have 2 htaccess files (one for example.com and the other for app.example.com).

Thanks in advance!

Edit:

File structure is Angular’s (it has Routing already) so it doesn’t make a difference

OS: CentOS 7, using Apache

Nginx not able to serve subdomain on same server as domain

On my nginx server (ubuntu 18.04), I want to host domain.com and apis.domain.com, where domain.com is one index.html file and apis.domain.com is a proxy to my node js api, which is running on port 3001.

I have 2 files in /etc/nginx/sites-available folder called domain.com and apis.domain.com and here are the contents from those files.

// domain.com server {         listen 80;         listen [::]:80;          root /var/www/domain.com/html/production;         index index.html          server_name domain.com www.domain.com;          location / {                 try_files $  uri $  uri/ =404;         } }  // apis.domain.com upstream domain_apis {         server 127.0.0.1:3001;         keepalive 64; }  server {     listen 80;     server_name apis.domain.com;   location / {         proxy_set_header X-Forwarded-For $  proxy_add_x_forwarded_for;         proxy_set_header X-Real-IP $  remote_addr;         proxy_set_header Host $  http_host;          proxy_http_version 1.1;         proxy_set_header Upgrade $  http_upgrade;         proxy_set_header Connection "upgrade";          proxy_pass http://domain_apis/;         proxy_redirect off;         proxy_read_timeout 240s;     } } 

when I hit domain.com, things are working fine. But when I hit apis.domain.com, it serves the page from domain.com root folder. I have replaced reverse proxy with simple server with another subdomain, but it always serves the root domain.

Any ideas on how to debug this and how to check if requests are hitting the correct block?

Filtering http responses for subdomain takeover

I try to automate a solution to check hosts for Subdomain takeover vuln. First I get all subdomain’s responses, then use the loop to checking keywords:

if grep -l 'Repository not found\|The specified bucket does not exist\|Github Pages site here\|No such app\|Sorry, this shop is currently unavailable\|404 Blog is not found\|is not a registered InCloud YouTrack' "$  X"; then     echo "$  line" >> ./$  1/$  foldername/vulnerable.txt fi 

Do I need more specific keywords to catch subdomain takeover vuln inside http response bodies? Or something different at all?

.htacces redirect for website and subdomain [closed]

I have a WordPress installation and a wildcard certificate.

Now I want to configure via .htaccess file the following:

Redirect http(s)://(www.)example.com to the URL https://www.example.com but links to http(s)://staticsub.example.com to the URL https://www.example.com/catecory/staticsub (if possible, that it shows in addressbar https://staticsub.example.com).

Is it possible? And if yes, how?

Connecting Google App Engine App with my subdomain

Our website is hosted with loopia at mydomain.com, but we also have a webapp running on Google App Engine which we would like to run on subdomain.mydomain.com.

We also have a couple of other subdomains running, but those are simply referred to via the IP address.

I have followed the steps at https://cloud.google.com/appengine/docs/standard/python/mapping-custom-domains#dns_update. The Domain Mappings consist of four A, four AAAA and one CNAME records.

When I try to add all of them to mydomain.com (the documentation isn’t clear if this should be the domain or subdomain), I get an error saying there are colliding records. When I try to add them to subdomain.mydomain.com, I’m able to add either the A’s and AAAA’s or the CNAME, but not both, or I’ll get a colliding record error again.

In both cases, subdomain.mydomain.com just displays a Google backed 404 error, while myapp.appspot.com is working without problems.

This is very similar to this question, except that we’re not using Google as our registrar.

How do I properly set up the DNS records so that the subdomain points to my webapp?

Point Subdomain in Google Domains to Google Compute Instance running WordPress

I have installed wordpress (the bitnami multi-site version) to a compute instance from the marketplace. I’ve also recently moved my domain registration to domains.google.com. Everything is working fine with the top-level domain. I also set up a subdomain, wp.mydomain.com in the domains interface pointed to the static external IP I configured for the compute instance running wordpress. When I go to wp.mydomain.com it redirects me to http://.xip.io/.

How do I get this set up so that I stay on wp.mydomain.com instead of going to my ip address as the url?

How do you redirect a subdomain and mask the URL?

I'm able to redirect a subdomain to a different folder on the server but need to mask it as well so it doesn't show as "subdomain.domain.com/folder" but rather "subdomain.domain.com".

Here's what I'm using for the redirect:
RewriteCond %{REQUEST_URI} ^/folder1 [NC]
RewriteRule .* subdomain1.co.luxury [P,L]

Any solution or ideas are appreciated.
Thanks,
Eric

change DirectoryIndex file for subdomain

I want two languages on my website – one french-specific website, and one in english for broader purposes (and no automatic translation). For maintenance reasons, I’d like to not duplicate images and CSS, … I also set up subdomains for language variants – for now both point to the www folder of my domain.

So I have two “index.htm” and “index_fr.htm” files, and a “fr” subdomain.

I’ve read up a bit about htaccess, and I’d like to set one up so that DirectoryIndex index_fr.htm is triggered when accessed through the subdomain.

Is it feasible? does it make sense? and how?

Is the _acme-challenge subdomain protected?

I was looking into the DNS-01 challenge of Let’s Encrypt; and I had a question about the sub domain process [1].

Let’s say, the website example.com gives away free subdomains; what stops me to request a Let’s Encrypt wildcard certificate for *.example.com, by claiming the _acme-challenge.example.com subdomain to process the DNS-01 challenge?

Is there anything in the ACME protocol (or anything else) that stops me from doing this?

[1] = https://letsencrypt.org/docs/challenge-types/#dns-01-challenge