: Help with htaccess code for navigation Possible Duplicate: I need a little help with .htaccess rewrite Hello, I need a little help with .htaccess file. I have songs, singers and
Possible Duplicate:
I need a little help with .htaccess rewrite
Hello,
I need a little help with .htaccess file. I have songs, singers and albums links I want to rewrite.
I already rewrote the links and they are like this:
for the songs is like this: /song/song_name
for singers: /singer_name
for albums: /album_name
This is the code in my .htaccess file:
RewriteEngine on
RewriteRule ^singer/([^/.]+)/?$ /core/controller.php?singer= [L]
RewriteRule ^song/([^/.]+)/?$ /core/controller.php?song= [L]
RewriteRule ^album/([^/.]+)/?$ /core/controller.php?album= [L]
I need the links for the songs, singers and albums to be like this:
for songs /singer_name/song_name
for singers /singer_name
for albums /singer_name/album_name
Can anyone help me with this please.
More posts by @Deb1703797
1 Comments
Sorted by latest first Latest Oldest Best
for /singer_name add:
RewriteCond !^(singer|song|album)
RewriteRule ^/?([^/.]+)/?$ /core/controller.php?singer= [L]
for /singer_name/song_name add:
RewriteCond !^(singer|song|album)
RewriteCond !^(album)
RewriteRule ^/?([^/.]+)(/([^/.]+))?.*$ /core/controller.php?singer=&song= [L]
for /singer_name/album/album_name add:
RewriteCond !^(singer|song|album)
RewriteCond (album)
RewriteRule ^/?([^/.]+)(/([^/.]+))?.*$ /core/controller.php?singer=&album= [L]
edit:
Sorry, but rewriting: /singer_name/song_name and /singer_name/album_name can not be done at the same time, as Apache doesn't know the difference between Song name and Album name, unless all song name start with numbers like: 01. Song Name
etc.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.