.htaccess 使用htaccess重写url?

.htaccess 使用htaccess重写url?,.htaccess,rewrite,.htaccess,Rewrite,我想使用.htaccess文件将test.domain.com/auth/login重定向到prod.domain.com/user。我该怎么做? 重新启动发动机 重写基/ #When your application folder isn't in the system folder #This snippet prevents user access to the application folder #Submitted by: Fabdrol #Rename 'application'

我想使用.htaccess文件将test.domain.com/auth/login重定向到prod.domain.com/user。我该怎么做? 重新启动发动机 重写基/

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^app.*
RewriteRule ^(.*)$ /index.php?/$1 [L]


#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

谢谢。

你的问题是什么?由于您已经在
.htaccess
样式文件中使用了重写,因此我们假设您知道如何工作。所以问题是:为什么你不能添加另一个规则来实现你所问的?如果你不明白你的问题是什么,我们帮不了你!实际上,htaccess文件是由其他人完成的。。我真的不明白htaccess文件是如何工作的。好吧,当然,我们都从某个地方开始。我建议您阅读关于重写的非常优秀的文档。你会发现,虽然它是技术性的东西,但它是可以阅读和理解的,并且它附带了大量的好例子,可以回答你所有的问题:谢谢。。我一定会读的