How to create a subdomain in localhost xampp? - .htaccess

I am working on my localhost (xampp). My URL of current directory is localhost/pms/. After login of User (with username XYZ), I want my URL to become localhost/XYZ.pms/.
How can I do this?

Related

How set base dir in htaccess

I have my website with structure of
mywebsite
index.php
index_admin.php
By rewriting though .htaccess
www.mywebsite.com/home/main --converts--> mywebsite/index.php
www.mywebsite.com/home/admin --converts--> mywebsite/index_admin.php
this is working (hosted)
Now I tried it to run on localhost for dev purpose using XAMPP Linux
url
localhost/mywebsite/index.php launched but when logined and navigate to url /home/admin it become localhost/home/admin which does not found. I want it to become /localhost/mywebsite/home/admin so that correctly navigate to index_admin.php file

Url without www redirect to different page

I am having a issue with the redirects of my URL using Microsoft Azure Web Service.
When I am executing www.myurl.com I am going to the correct page.
If I remove the www and execute myurl.com it redirects me to a incorrect page. The page that is shown, is only avaiable through a sub domain like login.myurl.com.
I am hosting on Microsoft Azure Server.
The root of the server basically contains the index.html on which the main page should redirect. However, without the www it redirect into a folder on root, and goes to the index.php inside that folder. There are more subfolders and it doesn't go into the alphabetic first one.
- www
-- index.html (this should be called)
-- // login folder
---- index.php (this is getting called without www)

Redirect /web url to / Symfony

My website is build with Symfony3.
I'm in front on a problem .
mywebsite.com/contact
is also accessible as
mywebsite.com/web/contact
I want to redirect all urls like mywebsite.com/web/something to mywebsite.com/something
Is it possible?
You have wrong configruation of your RootFolder, you need to setup your virtual hosts correctly

.htaccess - redirect if no subdomain and pass the wrong subdomain name to another page

I want to make the a redirect on .htaccess if someone put a wrong subdomain (that doesn't exist) and pass this subdomain phraze to the another page:
BAD SUBDOMAIN:
ABC.example.org
REDIRECTION:
my-page.com?validate=ABC
How can I do this?
Your subdomain must be resolved by a DNS server and if it is wrong(that doesn't exists) the browser will display error that can't find server. So, browser can't connect your server and how can .htaccess file work?

Redirect wrongly mistyped URL to main domain

I need to Redirect my mistyped url into main domain ..
For example if user type mistyped.domain.com or domain.com/mistyped (which does not exists) .It should display the content of domain.com but the url in adress bar should be same as mistyped.domain.com or domain.com/mistyped
Note : I googled and tried some of the .htaccess but its just redirecting.The url in the adressbar is not samejust domain.com not mistyped.domain.com.
Below code worked
./mysite.com
dirs and folders
./m.mysite.com
drwxr-xr-x main_site -> ../mysite.com

Resources