使用htaccess重写网址?

时间:2015-05-25 15:19:53

标签: .htaccess rewrite

我想通过使用.htaccess文件将test.domain.com/auth/login重定向到prod.domain.com/user。我该怎么办?     RewriteEngine On     RewriteBase /

#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]

感谢。

0 个答案:

没有答案