I searched in the board, but couldn't find it. So I decided to join you and ask.
With the help of these boards, I could, without any htaccess knowledge, successfully make my site http://johnny-depp.org much more friendly and remove all those /2008.php?02-15?page=12 etc. and make it beautifully looking with this code:
- Code: Select all
RewriteRule ^fans/list/([^/.]+)/$ /fans/?list&country=$1
RewriteRule ^fans/list/([^/.]+)/([^/.]+)/$ /fans/?list&country=$1&start=$2
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^/.]+)/([^/.]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^/.]+)/([^/.]+)/page([0-9]+)/$ /$1/$2.php?display=archives&page=$3
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^/.]+)/([^/.]+)/entry/([0-9]+)/$ /$1/$2.php?display=entry&id=$3
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^/.]+)/([^/.]+)/subcat/([0-9]+)/$ /$1/$2.php?display=subcat&subcatid=$3
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^projects/movies/([^/.]+)/$ /projects/movies/$1.php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^projects/scripts/([^/.]+)/$ /projects/scripts/$1.php
RewriteRule ^([^/.]+)/quotes/([^/.]+)/$ /$1/quotes/?$2
RewriteRule ^([^/.]+)/quotes/cats/([^/.]+)/$ /$1/quotes/index.php?cat&catid=$2
RewriteRule ^([^/.]+)/quotes/cats/([^/.]+)/page([0-9]+)/$ /$1/quotes/index.php?cat&catid=$2&page=$3
RewriteRule ^([^/.]+)/quotes/authors/([^/.]+)/$ /$1/quotes/index.php?author&author=$2
RewriteRule ^([^/.]+)/quotes/authors/([^/.]+)/page([0-9]+)/$ /$1/quotes/index.php?author&author=$2&page=$3
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([^/.]+)/([^/.]+)/([^/.]+)/$ /$1/$2.php?$3
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/.]+)/([^/.]+)/$ /$1/?$2
RewriteRule ^feed/$ /skins/feed.rss
I also have some other htaccess files in sub-folders f.e. for my galleries.
The only problem I have is, that people are still (from old links on other sites etc.) coming to the site from old links linked in discussion boards etc. and also in my own news script.
My question now is, how do I remove the old URLs, the "unfriendly" ones, to redirect to the new ones.
I tried with a 301 forwarding, but it gives me an internal server error because of a loop I build in like that.
Do you have any idea how I can achieve that?
Thanks for your help, Martina.