5 users online. Create an account or sign in to join them.Users
301 Redirects in .htaccess
This is an open discussion with 5 replies, filed under Installation.
Search
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.
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:
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:
Turns into this:
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!