I currently have a .htaccess file that rewrites dyhamb.com/episode.php?episode=1
as dyhamb.com/1
. I would also like another that rewrites dyhamb.com/blogpost.php?bp=1
as dyhamb.com/blog/1
.
I have the code set up for the episode rewrite already however when I go to add the blog rewrite I can't seem to get it to work. How would I alter the following to make that possible?
Options -Multiviews
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^dyhamb\.com$
RewriteRule ^(.*) http://dyhamb.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(0|[1-9]\d{0,2})$ /episode.php?episode=$1 [L,QSA]
RewriteRule ^/blog$ /blogpost.php?blog=$1 [L,QSA]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+episode\.php\?episode=(\d+) [NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+blogpost\.php\?blog=(\d+) [NC]
RewriteRule ^ %1? [R=301,L]