Serellyn
asked on
RewriteRule
Hey guys,
I want to rewrite the following link
artist/c/
to
index.php?browse=c
I know it's done in the .htaccess, I just can't figure out how to do this.
I want to rewrite the following link
artist/c/
to
index.php?browse=c
I know it's done in the .htaccess, I just can't figure out how to do this.
ASKER
Thank you for the response, but it is not working correctly yet.
the problem is that it's not working correctly yet.
Right now I have
<a href="artist/c/">C</a>
RewriteEngine On
RewriteRule ^artist/[a-z]+/$ /index.php?browse=$1
But the rewrite isn't working, it does not make index.php?browse=c of it.
the problem is that it's not working correctly yet.
Right now I have
<a href="artist/c/">C</a>
RewriteEngine On
RewriteRule ^artist/[a-z]+/$ /index.php?browse=$1
But the rewrite isn't working, it does not make index.php?browse=c of it.
ASKER
Okay, I fixed it myself, here it is.
RewriteRule ^artist/([a-z]{1})+/$ index.php?browse=$1
RewriteRule ^artist/([a-z]{1})+/$ index.php?browse=$1
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I understand what you mean, and I might change it.
if it brings too much trouble, I will change it to normal, so thank you.
if it brings too much trouble, I will change it to normal, so thank you.
RewriteEngine On
RewriteRule ^artist/[a-z]+/$ /index.php?browse=$1
This will do a silent rewrite (so the user's browser will not redirect and change the address shown in the address/location bar). Bear in mind that will cause a problem with images, etc, as the web browser will think it's in a directory called /artist/ which does not actually exist on your server.
Personally, I think index.php?browse=artistnam