【发布时间】:2018-10-16 15:16:53
【问题描述】:
我正在做一个网站建设者,我想让网址更漂亮。
网址例如:
https://ccc-bb.example.com => https://example.com/project/show/ccc/bb
这是我的 .htaccess 文件:
<IfModule mod_rewrite.c>
RewriteEngine On
# prevents files starting with dot to be viewed by browser
RewriteRule /\.|^\.(?!well-known/) - [F]
# front controller
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\-(.*)$ https://example.com/project/show/$1/$2 [L]
当我在上面使用 (https://ccc-bb.example.com) 时,它会将我发送到子域空文件夹。该文件夹只有 .htaccess 文件。
我错过了什么?我从未编辑过 .htaccess 文件,Google 也没有帮助我(或者我不知道我应该寻找什么)。
【问题讨论】:
标签: .htaccess mod-rewrite subdomain