views:

80

answers:

2

I need for my .htaccess file to take away the .php file extension and replace it with just a trailing slash.

Also, I have a profile.php page which will normally be visited with a numeric querystring parameter, like "profile.php?id=3".

So on top of replacing extensions with slashes, how do I make "profile.php?id=3" look like "profile/3/"?

So far all I have is the first line:

RewriteEngine on

Where do I go from here?

+4  A: 

If you're so new... you really should read the manual.

// if not a file
RewriteCond %{SCRIPT_FILENAME} !-f
// if not a directory
RewriteCond %{SCRIPT_FILENAME} !-d
// pass all params back to index.php
// QSA stands for query string append
// L stands for last rule
RewriteRule (.*) index.php?$1 [QSA,L]

But this will do what you want. Now don't be lazy. Read the manual!

Frankie
Don't be lazy, Google!
Sepehr Lajevardi
Pointless telling him not to be lazy after you've done the work for him :P
@MrXexxed, you're right... you're right... shouldn't have! :)
Frankie
A: 

This should do it

RewriteRule ^profile/(.*)$ profile.php?id=$1 [NC,L]
Lombo