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

How to make Apache 301 redirects a little less messy?

How Do I?

From EE Slack's avatar
From EE Slack
185 posts
2 years ago
From EE Slack's avatar From EE Slack

Long standing bugbear… dealing with .htaccess 301s on an ordinary LAMP set-up. Anyone have any knowledge how to make 301 redirects with ExpressionEngine a little less messy? Standard 301 redirect example:

301 /old_template_group/ example.com/new_template_group/

The resulting URL looks like this:

example.com/new_template_group/?/old_template_group/

I’d like to remove the ?/old_template_group/ part of this url… thoughts?

I can cover SEO issues with canonical URLS but from a user/sharing point of view it’s not ideal. Also not sure if this might affect the {last_segment} operator (although I suspect the ? character mitigates that concern…).

       
Ottenhoff Consulting's avatar
Ottenhoff Consulting
40 posts
2 years ago
Ottenhoff Consulting's avatar Ottenhoff Consulting

This is definitely a challenge.. Here’s what I’ve done for a long time to try to clean that up (though it still leaves a trailing ?)

Redirect 301 /activeoznz https://www.domain.com/destinations/new-zealand?

Though, I’ve largely (almost completely) switched to using Detour Pro to handle this stuff. Three big wins:

  1. In-CP editing, no .htaccess or other things that could break the site.
  2. Perfectly clean URL, every time.
  3. Detour Pro adds a lot of additional options for wildcards and pattern matching, and it counts the number times the redirects are used, so you can see how popular old links still are
       

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.