我的域指向Heroku中的Rails应用程序,因此,例如,当您要访问一些视频时,您将具有以下网址:
I have my domain pointed to a Rails app in Heroku, so for example, when you wanted to access some video, you would have an URL such as:
codigofacilito/video/W53XHWkbz34
我们需要将该应用程序更改为子域,因此更新的版本将是:
We need to change that app to a subdomain, so the updated version would be:
videos.codigofacilito/video/W53XHWkbz34
我想知道的是:
是否可以通过以下方式将人们重定向到带有子域视频的新网址使用.htaccess文件。
Is there a way to redirect people to the new url with the subdomain videos by using the .htaccess file.
推荐答案如果您只需要将此规则应用于视频路由,请提供以下内容尝试:
If you need this rule to only be applied to the video route, then give the following a try:
在文档根目录的 .htaccess 文件中,插入以下规则:
In your document root's .htaccess file, insert the following rule:
RewriteRule ^(video/.*)$ videos.codigofacilito/$1 [R=301,L,NC]更多推荐
将目录重定向到子域
发布评论