Post by KDNovelties » Tue Oct 31, 2017 11:46 pm

Hi, I have a lot of old (pre OC) urls with query strings that I need to redirect to the new url. Basically I just need to drop the url. For example I need this:
https://www.site.com/sesame-street/abc- ... view=write

changed to:

https://www.kdnovelties.com/sesame-stre ... ed_22.html

Just drop the ?review=write query string. How can I do this for multiple urls in the htaccess.

Thanks

User avatar
New member
Online

Posts

Joined
Sat May 27, 2017 12:12 am

Post by MrPhil » Thu Nov 02, 2017 6:25 am

Code: Select all

RewriteRule  ^(.*)$  https://www.kdnovelties.com/$1?  [R=301,L]
might do it for you. The '?' by itself should suppress any existing Query String. If you need to narrow the scope of which URLs are rewritten, add one or more RewriteConds.

Update: I just noticed I wrote RewriteCond instead of RewriteRule. Fixed. Also, since this is redirecting to another site (domain), you'll need the domain name too.

Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm
Who is online

Users browsing this forum: No registered users and 1 guest