![]() |
Apache Mod_Rewrite help needed.
i'm trying to make the default user profiles url http://www.qwerty.com/profile.php?user=john appear as http://www.qwerty.com/john and also be able to use http://www.qwerty.com/john/ with the slash. i want this for all users
i've tried a few rewrites and ended up just blocking the site |
Quote:
header("Location: http://www.qwerty.com/$_GET[user]") or similar in your php page. If you're trying to map /john (or /john/) to profile.php?user=john, that gets a little more interesting, because then ANY subdirectory would have to be considered a profile request. Is that what you're after? |
i want users to be able to type in http://www.qwerty.com/UserName/ or http://www.qwerty.com/UserName and pull up there account http://www.qwerty.com/profile.php?user=UserName
|
RewriteEngine on
RewriteRule ^/p/([^/]+) /profile.php?user=$1 Will redirect domain.com/p/john to the page you want. It's better to do it under /p/ or any other name you choose as opposed to the root dir. |
Quote:
i see you point, cause if a user makes and account called images and the redirect is on the root i'll be fucked or atleast the redirect would get confused. but is there a way around that? cause http://www.domain.com/UserName is so much cleaner looking and easier for a user to remember and tell someone |
Quote:
|
try this:
Options +FollowSymLinks RewriteEngine on RewriteRule profile/(.*)/(.*)/$ /profile.php?$1=$2 RewriteEngine on RewriteRule profile/(.*)/(.*)/?$ /profile.php?$1=$2 |
Quote:
|
bump ....
|
Quote:
|
All times are GMT -7. The time now is 01:31 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123