We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

301 RedirectMatch Rule Help

Development and Programming

jasonscooper's avatar
jasonscooper
1 posts
15 years ago
jasonscooper's avatar jasonscooper

I need to update one of the sections on my site to go from /current-directory/ to /new-directory/ but keep all of the file names the same. Making this update couldn’t be easier through the EE admin, but I need to setup a RedirectMatch rule to deal with 301 redirecting all of the old URLs.

Under normal circumstances this should work as a rule in my .htaccess file:

RedirectMatch 301 ^/current-directory/(.*) (mysitehere)/new-directory/$1

Except it doesn’t. I’m getting some extra parameter added on to the end of the URL, so that it comes out as:

(mysitehere)/new-directory/correct-page[b]?/current-directory/correct-page[/b]

I don’t know where the question mark and everything after it is coming from. I’m thinking it might be something that’s suppressed by EE or another rewriterule associated with EE, but I can’t tell.

Any help would be appreciated. Thanks!

       
Kevin Cupp's avatar
Kevin Cupp
791 posts
15 years ago
Kevin Cupp's avatar Kevin Cupp

Yes it looks like it’s trying to append the old string as a query string on the new URL, the EE rewrites may be an issue. Do you mind posting your entire .htaccess file? Seeing the order of the rewrites and other rules should give us a better idea.

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.