lostechies / wordpress

Our wordpress install
http://lostechies.com
Other
3 stars 2 forks source link

Redirect for "Printer Friendly" #12

Closed ChrisMissal closed 13 years ago

ChrisMissal commented 13 years ago

Google many posts indexed with the /printerfriendly.aspx ending that Community Server used to produce. I don't think that WP has this by default, but we could keep some "link love" by redirecting a url like:

http://lostechies.com/chrismissal/archive/2010/03/10/one-year-of-production-asp-net-mvc/printerfriendly.aspx

to:

http://lostechies.com/chrismissal/archive/2010/03/10/one-year-of-production-asp-net-mvc
jmeridth commented 13 years ago

I thought

RewriteRule ^/printerfriendly.aspx /$1 [R=301,L]

would work. it is not. still working on it

chadmyers commented 13 years ago

It's because you're doing ^/printerfriendly.aspx, the URL's don't start with /printerfriendly.aspx, they end with /printerfriendly.aspx

This may do it

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/printerfriendly.aspx.*$ $1 [L,R=301]
jmeridth commented 13 years ago

That did it. Thank you Chad.