php - .htaccess Pretty URL rewrite inside a folder -


i trying rewrite 1 of urls pretty urls can't seem figure out. here i've tried

current folder layout

-index.php -/instagram     -index.php     -.htaccess 

inside .htaccess have put code

rewriteengine on rewriterule ^instagram/([^/]*)$ /instagram/?username=$1 [l] 

my goal turn url

http://example.com/instagram/?username=test1234 

into url

http://example.com/instagram/test1234 

however, when go second url in browser gives 404 not found error. idea on how fix this?

place code inside /instagram/.htaccess:

directoryindex index.php rewriteengine on rewritebase /instagram/  rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^/]+)/?$ index.php?username=$1 [l,qsa] 

Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -