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
- apache virtual host settings (phpmyadmin)
- i want to transition from one servlet to another using redirect
- apache tomcat - i'm building an environment for using servlets
- 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
- python - how to get redirect url using "requests"
- apache - even if i set 301 redirect, it becomes 404
- apache - when i access it with a subdomain, i access the www domain
- i want to automate work using rpa on a virtual server at a fixed time every day
- 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
- apache - i have a question about how to redirect htaccess 301
- apache - local handlers are not loaded when a handler is uploaded to a remote server
- behavior differs when accessing from global ip and accessing from local ip with apache2
- apache - cannot redirect with htaccess
- mamp apache server does not start on windows 10
- the first domain setting written in apache with mamp is read
- mysql - apache needs open port 81 which is already used by httpd
- php - mamp "apache serve" does not start
- apache - cannot rewrite well only when subdirectory is entered in url