-1

I want Rewrite rule for .htaccess for change URL like below..

From

http://www.example.com/templates/professional_website/news.php?ac=post&id=2&p=1

To

https://www.example.com/templates/professional_website/news/post/2/1
Cœur
  • 37,241
  • 25
  • 195
  • 267
  • For this question there are already about 5658264764856 answers that have been written alone here on SO. None of all of those answered your issue? _Why not_? Why should the 5658264764857th answer be different? – arkascha Dec 08 '16 at 13:57
  • Please note that you are expected to research before asking a question and that you are expected to have tried to solve your issue yourself. We are only here to help you with your search and attempt. We are not here to do your work for you. – arkascha Dec 08 '16 at 13:58
  • Just as an arbitrary example picked from the "Related" section at the right side: http://stackoverflow.com/questions/20621565/htaccess-and-rewrites-rules?rq=1 – arkascha Dec 08 '16 at 13:59
  • Have you really tried any rewrite rule? – anubhava Dec 08 '16 at 15:33
  • I have already tried, but I am not getting actual answer because I have url like 'http://www.example.com/templates/professional_website/' and then i want to apply rewriting. not directly after domin – Himanshu Upadhyay Dec 09 '16 at 04:24
  • ok then I suggest you show your current (even if not working) rules in question. – anubhava Dec 09 '16 at 11:08
  • Possible duplicate of [How can I create friendly URLs with .htaccess?](http://stackoverflow.com/questions/3033407/how-can-i-create-friendly-urls-with-htaccess) – Cœur Dec 31 '16 at 19:55

1 Answers1

1

Untested answer taken from a random linked question:

RewriteEngine on
RewriteRule ^templates/professional_website/news/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ templates/professional_website/news.php?ac=$1&id=$2&p=$3 [L,NC,QSA]
RewriteRule ^templates/professional_website/news/([^/\.]+)/([^/\.]+)/?$ templates/professional_website/news.php?ac=$1&id=$2 [L,NC,QSA]
Cœur
  • 37,241
  • 25
  • 195
  • 267