simple .htaccess redirect : how to redirect with parameters?

前端 未结 3 1926
醉梦人生
醉梦人生 2021-01-03 03:22

My goal is simply to redirect:

/jsn.php?parameters to http://www.site2.com/jsn.php?parameters

I tried with

Redirec         


        
3条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-03 03:47

    Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:

    Options +FollowSymLinks -MultiViews
    # Turn mod_rewrite on
    RewriteEngine On
    RewriteBase /
    
    RewriteRule ^(jsn\.php)$ http://www.site2.com/$1 [L,NC,R=301]
    

提交回复
热议问题