views:

21

answers:

1

My current http access file is

# Pound sign comments a line out

# Disallow viewing of htaccess files
<Files .htaccess>
order allow,deny
deny from all
</Files>

Options +FollowSymLinks
RewriteEngine On

# enable hiding php extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php 

Right now it just hides the .php, i still want to hide the .php but allow website/user/Username

+1  A: 

Here you go:

RewriteEngine On
RewriteRule ^user/(.*) profile.php?user=$1 [L]
bradym
Not working. I added it to the end of my haccess file.
Keverw
What exactly do you mean by "not working". Are you getting an error? What kind of error? I copied your .htaccess file above and added the RewriteRule I posted to the end of it, and it works for me.
bradym
"Oops! This link appears to be broken." I ran a2enmod rewriteand then /etc/init.d/apache2 restart so i know mod rewrite is on...
Keverw
Can you check your apache error log? That should provide more details. Sounds like you're on Ubuntu, so it's probably in /var/log/apache2/error.log.
bradym
Had to modify my 000-default file. It works now! Thanks.
Keverw