Jump to content

htaccess redirecting a rewritten rule


JKG

Recommended Posts

hey, i have a site which runs this as its rewrite, it works:

 

RewriteEngine on

RewriteCond %{HTTP_HOST} ^site.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.site.com$
RewriteRule ^/?$ "http\:\/\/www\.site\.com\/Sitename\-homepage" [R=301]

RewriteRule ^Sitename-([^/]*)$ /index.php?page=$1 [L]

 

i want to now add a redirect to this, this works but appends the orginal query string, how do i tell it not to do that?

 

Redirect 301 /Sitename-home http://www.site.com/Sitename-homepage

 

this rule redirects to:

http://www.site.com/Sitename-homepage?page=home

 

which isnt what i want. is there an append thats the opposite of [QSA]?

 

thanks.

Link to comment
https://forums.phpfreaks.com/topic/246713-htaccess-redirecting-a-rewritten-rule/
Share on other sites

hi cags, thanks for your reply.

 

i tried it, and it does strip the url of the query string, but also displays a question mark at the end of the url, which is not ideal.

i tried just putting a space but it went back to what it was doing before.

 

any other ideas?

thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.