We are building a website using MAMP.
You have now successfully set up a virtual host and displayed it in its subdomain (eg hoge.localhost).
<VirtualHost *: 80> DocumentRoot "/ Applications/MAMP/htdocs/hoge /" ServerName hoge.localhost </VirtualHost>
So, if you access the original address (eg http: // localhost/hoge /), how can you redirect it to a subdomain?
<Directory /> Redirect/http: //hoge.localhost/ </Directory>
RewriteEngine on RewriteRule ^ localhost/hoge/$http: //hoge.localhost [L, R = 301]
I tried, but it was not redirected.
I'm sorry for the lack of knowledge, but I would appreciate it if someone could tell me.
Answer # 1
A case of XAMPP, but if Apache httpd, the reasoning is the same, so is it helpful?
Create a subdomain with Xampp-Qiita
Set the subdomain to Apache localhost – ABC Blog
Answer # 2
I haven't tested it.
DocumentRoot "where there" ServerName localhost Redirect permanent/hoge http: //hoge.localhost
Answer # 3
Assuming localhost is not a virtual domain, enterin httpd.conf
Redirect permanent/hoge http: //hoge.localhost
- vuejs - i want to implement virtual scrolling using v-virtual-scroller
- apache - when i access it with a subdomain, i access the www domain
- apache - web application development using linux and apach
- i want to know how to use apache virtual host with docker
- apache - exclude a directory and redirect
- apache - how to redirect from the top page to the subdirectory url
- apache - py using cgi on sakura rental server becomes internal server error
- apache - how to write virtual host and reverse proxy settings
- i want to use the server_name url using nginx virtual host
- i want to run python on apache using mod_wsgi (cd python-360 gives an error)
- python - i want to pass the module path when using the virtual environment created by virtualenv with jupyter notebook
- i want to transition from one servlet to another using redirect
- python - how to get redirect url using "requests"
- i want to automate work using rpa on a virtual server at a fixed time every day
- when using apache external media as the document root, it becomes 403 forbidden
- macos (osx) - virtual machine using virtualbox cannot be viewed in firefox
- tensorflow 230 cannot be imported when using apache
- apache - i want to redirect a png image with the same name from the old domain to a domain managed separately
- python - i want to edit a py file using a virtual environment with vs code
- php - about apache virtual host settings
- php : .htaccess 301 Redirect except some addresses
- php - i have a question about mamp
- apache - htaccess cannot restrict ip
- php - http error 500 mamp
- php - mamp not jump to next sheet
- php - i want to display wordpress site locally on mamp pro5
- apache - error occurred after mamp port setting
- behavior differs when accessing from global ip and accessing from local ip with apache2
- apache - cannot redirect with htaccess