Sigve Aleksander
Sigve Aleksander

Reputation: 1

.htaccess rewrite /profile.php?username=Something

I had this code before

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /lr/profile.php?username=$1

But that makes the profiles go to coolsite.com/Something I want the profile link go to /profile/Something instead of profile.php?username=Something

How can i do that?

Upvotes: 0

Views: 596

Answers (1)

joshOfAllTrades
joshOfAllTrades

Reputation: 1982

Unless there is more to your question then I'm seeing, simply changing your RewriteRule to something like the following should do the trick.

RewriteRule ^profile/(.*)$ /lr/profile.php?username=$1

Upvotes: 1

Related Questions