简体   繁体   中英

htaccess RewriteCond & RewriteRule

I've pulled most of whatever was left of my hair out on this one, and my feeling is that the answer is quite simple.

I have a URL:

https://www.example.com/?download= {rest of query string here}

and I want to rewrite that into

https://www.example.com/index.php?download= {rest of query string here}

The user doesn't need to be redirected. But I cannot figure this out. I tried 50 or 60 different things and I'm hoping someone can help.

Have you tried simply:

DirectoryIndex index.php

In the htaccess file in your document root?

Or try:

RewriteEngine On
RewriteCond %{QUERY_STRING} ^download=
RewriteRule ^$ /index.php [L]

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