【发布时间】:2017-10-18 17:56:26
【问题描述】:
我有 2 个网站
- 购物网站 (Magneto 1)
- 博客网站 (Laravel)
我有一个域,例如http://www.shopnow.com/,所以我需要在根目录中设置.htaccess 文件,以便
- http://www.shopnow.com ==> public_html/shop
- http://blog.shopnow.com ==> public_html/blog
我已经在根文件夹中尝试.htaccess
# .htaccess main domain to subdirectory redirect
# Do not change this line.
RewriteEngine on
# Change example.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?shopnow.com$
# Change 'subdirectory' to be the directory you will use for your main domain.
#RewriteCond %{REQUEST_URI} !^/shopnow/
# Don't change the following two lines.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change 'subdirectory' to be the directory you will use for your main domain.
RewriteRule ^(.*)$ /shopnow/$1
# Change example.com to be your main domain again.
# Change 'subdirectory' to be the directory you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?shopnow.com$
RewriteRule ^(/)?$ /shopnow/index.php [L]
【问题讨论】:
标签: php .htaccess magento url-rewriting laravel-5.3