英文:
Redirect a specific subdomain to a different URL in apache2 linux server
问题
有人能帮我将特定子域名重定向到 apache2 Linux 服务器中的不同 URL 吗?
英文:
Can someone help me Redirecting a specific subdomain to a different URL in the apache2 Linux server
答案1
得分: 1
创建一个名为.htaccess
的文件,并将以下内容复制到其中:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^test.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/page [L]
根据需要替换域名和地址。
文档链接:httpd.apache.org/docs/2.4/rewrite/remapping.html
英文:
make a file named .htaccess
, and give it the following content:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^test.example.com$ [NC]
RewriteRule ^(.*)$ http://example.com/page [L]
replace domain and address as needed
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论