我不太确定术语是什么,但我想要做的就是在mydomain.com之后重定向URL,例如mydomain.com/todays-news。
我如何指出这个“今日新闻”网址让我们说一个目录中的文件就像投资组合一样?
你还把这个结尾的网址叫做什么?子域名?
答案 0 :(得分:0)
将此添加到您的web_root/.htaccess
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^todays-news/?$ /portfolio/some_file.php [NC,L]
rewriteRule会在内部将example.com/today-news
重定向到example.com/portfolio/somefile