This is really doing my head in! It was fucking working fine and now it's not... argh!!
It's a lyrics site and I need to do 2 things:
301 artist.lyricssite.com to lyrics.lyricssite.com/lyrics/search.php?find=artist
and also rewrite the other urls to lyrics.lyricssite.com/lyrics/letter/artist/album/title
It was working fine with the lyrics subdomain added in cpanel before I moved servers, now it doesn't like that but it should be doable with just htaccess and the wildcard dns entry.....
I wouldn't mind ditching the lyrics subdomain really, only keeping it as I had other stuff there and it's currently indexed like that.
Here's what I've got at the mo (complete with other stuff I've tried commented out!)
root .htaccess:
in lyrics folder:
It was sending everything to find=lyrics, now I'm getting a 500 error. Prob something stupid... anyone help? pretty please!!
It's a lyrics site and I need to do 2 things:
301 artist.lyricssite.com to lyrics.lyricssite.com/lyrics/search.php?find=artist
and also rewrite the other urls to lyrics.lyricssite.com/lyrics/letter/artist/album/title
It was working fine with the lyrics subdomain added in cpanel before I moved servers, now it doesn't like that but it should be doable with just htaccess and the wildcard dns entry.....
I wouldn't mind ditching the lyrics subdomain really, only keeping it as I had other stuff there and it's currently indexed like that.
Here's what I've got at the mo (complete with other stuff I've tried commented out!)
root .htaccess:
Code:
Options +FollowSymlinks
#Options +Indexes
RewriteEngine On
#RewriteBase /
#RewriteCond %{REQUEST_URI} ^lyrics\.lyricssite\.com$
#RewriteRule ^lyrics/([^/]*)\.html$ /index.php?letter=$1 [L]
#RewriteRule ^lyrics/([^/]*)/([^/]*)\.html$ /index.php?letter=$1&artist=$2 [L]
#RewriteRule ^lyrics/([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?letter=$1&artist=$2&album=$3 [L]
#RewriteRule ^lyrics/([^/]*)/([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?letter=$1&artist=$2&album=$3&title=$4 [L]
#RewriteCond %{HTTP_HOST} ^lyrics\.(.*)
#RewriteRule ^(.*)$ http://%1/lyrics/$1
#RewriteCond %{HTTP_HOST} !lyrics.lyricssite.com$ [NC]
#RewriteCond %{HTTP_HOST} ^(lyrics.)?([a-z0-9-]+).lyricssite.com [NC]
#RewriteRule (.*) %2/$1 [L]
#to prevent rewrite loops
RewriteCond %{REQUEST_URI} !^/index.php?(.*)?$
RewriteCond %{REQUEST_URI} !^/search.php?(.*)?$
# if not lyrics.
#RewriteCond %{HTTP_HOST} !^lyrics\.lyricssite\.com$
# match the subdomain
RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.lyricssite\.com$ [NC]
# append the path
RewriteRule ^(.*)$ /lyrics/search.php?find=%2&field=artist [R=301, L]
Code:
RewriteEngine On
RewriteRule ^lyrics/([^/]*)\.html$ /index.php?letter=$1
RewriteRule ^lyrics/([^/]*)/([^/]*)\.html$ /index.php?letter=$1&artist=$2
RewriteRule ^lyrics/([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?letter=$1&artist=$2&album=$3
RewriteRule ^lyrics/([^/]*)/([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?letter=$1&artist=$2&album=$3&title=$4 [L]
It was sending everything to find=lyrics, now I'm getting a 500 error. Prob something stupid... anyone help? pretty please!!