GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Apache Mod_Rewrite help needed. (https://gfy.com/showthread.php?t=428860)

acctman 02-08-2005 12:59 PM

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

rickholio 02-08-2005 01:06 PM

Quote:

Originally Posted by acctman
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

So what are you trying to do here, exactly... push a user from profile.php?user=blah to /blah? If so, just use a

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?

acctman 02-08-2005 01:17 PM

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

pornRefinery 02-08-2005 01:22 PM

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.

acctman 02-08-2005 01:31 PM

Quote:

Originally Posted by pornRefinery
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.


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

acctman 02-08-2005 01:43 PM

Quote:

Originally Posted by pornRefinery
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.

hmm that didn't work :(

Jayo 02-08-2005 03:15 PM

try this:
Options +FollowSymLinks
RewriteEngine on
RewriteRule profile/(.*)/(.*)/$ /profile.php?$1=$2

RewriteEngine on
RewriteRule profile/(.*)/(.*)/?$ /profile.php?$1=$2

acctman 02-08-2005 04:50 PM

Quote:

Originally Posted by Jayo
try this:
Options +FollowSymLinks
RewriteEngine on
RewriteRule profile/(.*)/(.*)/$ /profile.php?$1=$2

RewriteEngine on
RewriteRule profile/(.*)/(.*)/?$ /profile.php?$1=$2

that sort of works, but images aren't loading

acctman 02-08-2005 08:41 PM

bump ....

wimpy 02-08-2005 10:09 PM

Quote:

Originally Posted by acctman
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

Just be sure to create your own user login for any dir that you use yourself.


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