0

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 Answer 1

1

Here you go:

RewriteEngine On
RewriteRule ^user/(.*) profile.php?user=$1 [L]
Sign up to request clarification or add additional context in comments.

3 Comments

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.
"Oops! This link appears to be broken." I ran a2enmod rewrite and then /etc/init.d/apache2 restart so i know mod rewrite is on...
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.