Error on SEO friendly url

- 1 answer

Ad
Options +FollowSymLinks

RewriteEngine On
RewriteRule ^([a-zA-Z0-9-]+)/?$ listenAlbum.php?url=$1
RewriteRule ^([a-zA-Z0-9-]+)/category/?$ category.php?name=$1

I am having this .htaccess file when i try to open http://mywebsite.com/my-album it works perfect but when i try to navigate on category page like this http://mywebsite.com/category/category-name it give a 404 Not Found Can any one help with this ?

Ad

Answer

Ad

The second RewriteRule if your htaccess says the URL should be http://mywebsite.com/category-name/category/.

Change your htaccess to:

RewriteEngine On
RewriteRule ^([a-zA-Z0-9-]+)/?$ listenAlbum.php?url=$1
RewriteRule ^category/([a-zA-Z0-9-]+)/?$ category.php?name=$1
Ad
source: stackoverflow.com
Ad