0

Hi i would like to change the url from:

http://example.com/news.php?id_news=1 to http://example.com/news/1

and

http://example.com/works.php?id_works=14 to http://example.com/works/14

with .htaccess

John Saunders
  • 160,644
  • 26
  • 247
  • 397
luckr
  • 73
  • 7
  • 1
    That's nice. Good luck figuring it out. Did you have a question? – Marc B Feb 06 '15 at 19:26
  • Unlike forum sites, we don't use "Thanks", or "Any help appreciated", or signatures on [so]. See "[Should 'Hi', 'thanks,' taglines, and salutations be removed from posts?](http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts). BTW, it's "Thanks in advance", not "Thanks in advanced". – John Saunders Feb 07 '15 at 05:16

1 Answers1

0

My guess out of the blue is something like

RewriteEngine On
RewriteCondition %{QUERY_STRING} ^id_([a-z]+)=([0-9]+)$ 
RewriteRule /^%1\.php$/ %1/%2?
Hagen von Eitzen
  • 2,109
  • 21
  • 25