5 users online. Create an account or sign in to join them.Users

Search

I'm trying to add some redirects to my Symphony install so links from a few of my old pages on my site will permanently redirect to the new URLs.

I have this in the .htaccess file:

Redirect 301 /2007/04/30/more-psp-hackery-ripping-ps1-games-in-osx/ http://www.joshnichols.com/blog/entry/more-psp-hackery-ripping-ps1-games-in-osx/

When I try to go to the old address it redirects, but the URL gets extra code added to the end and Symphony gives an error 404

This link:

http://www.joshnichols.com/2007/04/30/more-psp-hackery-ripping-ps1-games-in-osx/

Turns into this:

 http://www.joshnichols.com/blog/entry/more-psp-hackery-ripping-ps1-games-in-osx/?page=2007/04/30/more-psp-hackery-ripping-ps1-games-in-osx

The same thing happens with regular .htaccess redirects. I'm guessing Symphony's .htaccess code is doing something.

Anyone have experience with 301 redirects in Symphony that could help me solve this? I hope there's a fix that doesn't require editing Symphony's default .htaccess code.

Thanks!

Did you place this redirect before or after Symphony's rules?

I tried it in both spots with the same results.

I think I figured it out. Right after this bit of code in the Symphony-generated .htaccess,

### Symphony 2.0 - Do not edit ###

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteBase /

put in your redirects like this:

 ### Redirects from old site
 RewriteRule ^2007/04/30/more-psp-hackery-ripping-ps1-games-in-osx/$ http://www.joshnichols.com/blog/entry/more-psp-hackery-ripping-ps1-games-in-osx/ [R=301,L]

The bit between the ^ and the $ is the old URL and then the second part, after a space, is the new URL. [R=301,L] means it's a 301 redirect and to end the RewriteRule. To add more redirects, just add a new RewriteRule on the next line.

Oh, and if you have a URL to redirect that uses an extension, don't forget to escape the . with a \.

Like this:

RewriteRule ^2007/04/30/more-psp-hackery-ripping-ps1-games-in-osx/index\.php$ http://www.joshnichols.com/blog/entry/more-psp-hackery-ripping-ps1-games-in-osx/ [R=301,L]

Glad you figured out. Thanks for posting the follow-up solution!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.2 or above
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.0 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details