ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

301 Redirect problem

April 01, 2012 4:48pm

Subscribe [2]
  • #1 / Apr 01, 2012 4:48pm

    Charming Nerd

    196 posts

    I am trying to redirect some old URL’s and EE is hijacking them. Specifically, this is the url I am trying to redirect.

    Redirect 301 /trips/tripdetail.cfm?TripID=26 http://adventurescrosscountry.com/trips/africa-service

    It displays my template in the template group ‘trips’  and the last entry for that channel. Bascially, it is ignoring the redirect thinking that you want to display an entry. Here is the full htaccess file.


    <IfModule mod_rewrite.c>
          RewriteEngine On

          # Removes index.php
          RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)$ /index.php/$1 [L]

          # If 404s, “No Input File” or every URL returns the same thing
          # make it /index.php?/$1 above (add the question mark)
    </IfModule>

    #################################################

      # 301 Redirects

    #################################################


    Redirect 301 /trips/search/category/trip-activites /trips/calendar
    Redirect 301 /trips/search/category/trip-locations /trips/map
    Redirect 301 /trips/tripdetail.cfm?TripID=26 http://adventurescrosscountry.com/trips/africa-service

     

  • #2 / Apr 02, 2012 1:55pm

    Shane Eckert

    7174 posts

    Hey Charming Nerd,

    I am sorry to hear you are running into this problem.

    .htaccess is a bit outside of support for ExpressionEngine. The only bit of code that we suggested is the removal of index.php and even that is not guaranteed in all server environments.

    I can move this over to the Community Help Forum if you would like? The community may have some tips for you.

    I am sorry I could not be of more help.

    Cheers,

  • #3 / Jun 07, 2012 9:43pm

    fnd

    15 posts

    Not sure if you still need help but one way to do it is to add another rewrite to pass that entire dir through:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !trips/
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]
    </IfModule>

  • #4 / Jun 07, 2012 10:14pm

    Shane Eckert

    7174 posts

    Hey wildermagic,

    Thanks for the tip! I am sure it will be helpful to the community.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases