1

I would like to know how to remove finename and extension from a URL using .htaccess file.

These are the URL's

/post.php?id=1&title=test-title
/user.php?id=1&name=username
/about.php

I don't want to remove the file name from about,php

So i want the output to be like below

/1-test-title
/1-username
/about

Can someone point me out the best way to do this?

max
  • 331
  • 1
  • 3
  • 11
  • 1
    "how to remove finename and extension" and "I don't want to remove the file name" - discrepancy in your words? – RomanPerekhrest Apr 17 '16 at 08:46
  • 1. you apparently have to read a bit more about how URL rewriting actually works. Your statement "i want the output to be like" suggests that. URL rewriting does not create any output. Don't get this wrong, we all started, it is fine to not know things. But this is an issue of general understanding which is not easy to deal with here. 2. there are about 659326559365 examples for simple URL rewriting alone here on StackOverflow. None of those helped you? If not, why do you think that the 659326559366th example _will_ help you? – arkascha Apr 17 '16 at 08:50
  • http://stackoverflow.com/questions/4026021/remove-php-extension-with-htaccess – RomanPerekhrest Apr 17 '16 at 08:55
  • If someone is sending a URL `/10-something` to you how should that be rewritten? – anubhava Apr 17 '16 at 09:04

0 Answers0