Forum Moderators: phranque

Message Too Old, No Replies

URL mod rewrite Help!

         

rodriguez1804

10:14 pm on Jul 26, 2008 (gmt 0)

10+ Year Member



Ok, here's what I am trying to do:
I want to shorten the path to each username's home directory.
Currently I have it to where each user's home directory looks like so,

ex:
username: John -> first letter is "J"
URL: [mysite.com...] (nasty URL!)

what I want to do is shorten the url to something like this:

ex:
username: John
URL: [mysite.com...] (Much better URL)

In a previous post, our fellow member Sekka stated that I should do something like the following to fix this:


RewriteEngine on
RewriteCond %{REQUEST_URI} ^/user/
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ userpage.php [L,QSA]

However, after trying this several times with my .htaccess (located at root folder), I had no success.

Can somebody please show me how to implement the above URL re-writes. Thanks much!

jdMorgan

2:32 pm on Jul 27, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That code does not appear to do anything like what you're asking about. To get started, please see our Apache Forum Charter, the cited references in that Charter, and the threads in our Apache Forum Library.

Thanks,
Jim