简体   繁体   中英

Redirect using .htaccess file. How?

I have a file as "documentRoot/app/webroot/myFile.php"

I need to be able to access this file at "mySite/myFile.xml" ie when i type myFile.xml a call should goto "documentRoot/app/webroot/myFile.php"

How can i do this by using .htaccess file??

Options +FollowSymlinks
RewriteEngine on

RewriteRule ^(.+)\.xml$ documentRoot/app/webroot/$1.php [L]
Redirect 301 /mySite/myFile.xml http://example.com/documentRoot/app/webroot/myFile.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM