.htaccess rewrite rule rewriting 301 redirects

前端 未结 2 713
长情又很酷
长情又很酷 2021-01-21 10:29

I have a problem with my .htaccess redirects. I have both a rewrite rule to remove the \"index.php?/\" from my URLs (I\'m using a PHP framework), and also 301 redirects redirect

2条回答
  •  情深已故
    2021-01-21 10:50

    Your issue is that this line: RewriteRule ^(.*)$ /index.php?/$1 [L] forces a query parameter in that rewrite. Some hosts are setup this way, one I know of in particular is DreamHost. So, anything that is redirected appears broken.

    You can try this

    RewriteRule ^dir/file.php$ http://webpage/newdir/file2.php [R=301,L]

提交回复
热议问题