简体   繁体   中英

301 redirect with .htaccess shows query string in url

I have a redirect rule in .htaccess .

This is the rule:

Redirect 301 /ielts-sat http://www.example.com/ielts-training-in-kuwait

It redirects properly but the result page URL shows as http://www.example.com/ielts-training-in-kuwait?/ielts-sat .

How I remove this query string?

You can try below rule :

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteRule ^ielts-sat$ /ielts-training-in-kuwait? [L,R=301]
</IfModule>

Did you enable the RewriteEngine ? Try above code in different browser.

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