0

Possible Duplicate:
Redirect *.php to clean URL

I am sure this has been asked here before, but for some reason whatever I am trying doesn't seem to work.

What I have is: http://example.com/share/edit.php?id=59

What I want is: http://example.com/share/59

My .htaccess is:

RewriteEngine on
RewriteRule ^share/([0-9]+)$ share/edit.php?id=$1

Is there something I am doing wrong? The .htaccess file is in example.com/share directory.

Community
  • 1
  • 1
Geocrafter
  • 145
  • 10

4 Answers4

0

Try to put your .htaccess to example.com directory.

xdazz
  • 158,678
  • 38
  • 247
  • 274
0

Try giving it this way:

RewriteEngine On
RewriteRule ^share/([^/]*)$ /share/edit.php?id=$1 [L]

And your .htaccess file should reside in the root directory, i.e., example.com's directory,. where the share folder is there.

Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
0

If the .htaccess is in the share directory then you don't need to specify the URL path. Try something like this:

RewriteEngine On
RewriteRule ^(.*)$ edit.php?id=$1 [QSA,L]

It also goes without saying that should you be using apache you will need mod_rewrite enabled.

Tyler
  • 1,291
  • 1
  • 13
  • 20
-1

The '.htaccess' file is in 'example.com/share' directory.

Move it to the upper level directory (public_html or www).

Paul Denisevich
  • 2,329
  • 14
  • 19