View Single Post
Old 02-26-2010, 01:35 PM  
LustyVixens
Registered User
 
LustyVixens's Avatar
 
Join Date: Feb 2010
Posts: 79
Are you sure you are rewriting? At the moment it seems more like a redirect (on your website). The problem with rewriting cial.com/User to cial.com/view/USER.html is that your website will need to know that cial.com/xxx is a user else accessing a regular page such as cial.com/support will try to redirect with a "member" of that username.

Instead I would rewrite matches to send the part after the / to a PHP file that will query the database to determine whether it is in fact a user and if so, redirect to the user profile.

I'm not really sure what your setup is so I don't want to post any code, but for sites I develop I usually send everything that is not a physical file or directory (indicated by !-f and !-d in the .htaccess) through my controller script, e.g.

Code:
RewriteEngine on

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

RewriteRule ^(.*)$ __controller.php?p=$1 [L,QSA]
LustyVixens is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote