apache - Php url rewrite and redirect in htacess -


i want redirect site friendly. have website pull data database , adress /post?id=1 , want change /post/1 wrote code rewrite cant make sense google research how redirect /post/1.

my code

options +followsymlinks  rewriteengine on  rewriterule ^post/([^/.]+)/?$ post.php?id=$1 [l] 

use:

options +followsymlinks rewriteengine on  # external redirect actual url pretty 1 rewritecond %{the_request} \s/+post\.php\?id=([^\s&]+) [nc] rewriterule ^ /post/%1? [r=301,l,ne]  # internal forward pretty url actual 1 rewriterule ^post/([^/.]+)/?$ post.php?id=$1 [l,qsa,nc] 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -