Jump to content

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!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.