Hey guys,

I want to rewrite the following link

I know it's done in the .htaccess, I just can't figure out how to do this.
Who is Participating?
HackneyCabConnect With a Mentor Commented:
My mistake, sorry. Without the parentheses, the $1 doesn't actually refer to anything.

I still think that a URL like /index.php?artist=c or /artist.php?name=c looks fine. The craze for "SEO" rewrites leaves me cold. For instance, /artist/c/ is two sub-directories deep, whereas /artist.php is in the top-level directory. Word used to be that Google rated deep-directory documents lower than top-level documents. This may have changed, but I still regard these "pretty" URLs with caution.
Try the following:

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=artistname looks fine, but I seem to be in the minority.
SerellynAuthor Commented:
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.
SerellynAuthor Commented:
Okay, I fixed it myself, here it is.

RewriteRule ^artist/([a-z]{1})+/$ index.php?browse=$1
SerellynAuthor Commented:
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.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.