htaccess redirect profile page

Tags: ,

I’m creating a system which shows your profile if you visit

I would like to make it so you could go to and it would still work. At the same time I would like it to show ^^ as the url if you visit

How can this be done?


This should do :

RewriteEngine on
RewriteRule ^profile/(.*)$$1 [L]

You want to match everything after profile/ to the end of URI, and then pass it as parameter value to your “real” URI.

[L] flag may not be necessary, it indicates the rewrite engine you’re done and it does not have to go throught the next rules.

You can try it here

Edit : I just see @Peter’s comment, you definitively should read the question he linked, it will help you understand the whole thing.

Source: stackoverflow