I'm creating a web application where people can make profiles. Their Profile is saved at: application/user/UserName. I would like the Hyperlink to end up like this: application/UserName but can't because I've already set the the url : application/CategoryName/StoryName where you will find plenty of Groups like Technology, Fashion, etc. Here's my htaccess content:

Options +FollowSymLinks
RewriteEngine on
ErrorDocument 404 /ef12/error/404.html
RewriteRule user/(.*)/ u.php?name=$1
RewriteRule user/(.*) u.php?name=$1
RewriteRule (.*)/(.*)/ scoop.php?cat=$1&title=$2
RewriteRule (.*)/(.*) scoop.php?cat=$1&title=$2
RewriteRule (.*)/ scoop.php?cat=$1
RewriteRule (.*) scoop.php?cat=$1

I would like anyone's Profile To Look Like:


and tales to look like:


I understand it is possible: example > Twitter: twitter.com/Abhishek_Biswal and twitter.com/about in which the former is really a profile and also the latter is really a page about Twitter.

Company, I've also got Sites like Login and Register ( http://app/Login ), that also Conflicts using the Rules, that's, after i attempt to access Login directory, the server assumes Login because the UserName ( after i have set the profile url as http://app/UserName in htaccess ) along with a "No Profile" Error is proven.


Add wrinkles prior to the rules. They avoid the rule from taking effect if your file or directory exist that match the URL:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d