apache - how create clean urls using htaccess -
hi want create clean urls htaccess file not create effect.
original url - http://example.com/abc/def/?page=1
required url - http://example.com/abc/def/page/1
i using following htaccess file. want place file in def directory
rewriteengine on rewriterule ^([a-za-z0-9]+)$ page?id=$1 rewriterule ^([a-za-z0-9]+)/$ page?id=$1
if def
indeed directory, use following inside it:
rewriteengine on rewritecond %{the_request} ^get\ /(.+?)/?\?(page)=(\d+) [nc] rewriterule ^ %1/%2/%3? [r=301,l] rewritecond %{request_uri} ^/(.*)/page/(\d+) rewriterule ^(page)/(\d+)/?$ /%1/?page=$2 [nc,l]
Comments
Post a Comment