.htaccess - htaccess rewrite get url section not working -
i trying rewrite url example.com/parts/toolbucket/part.php?id=1
example/toolbucket/part/1
i have of .htaccess working last part of rewrite doesn't work.
this .htaccess
options -indexes rewriteengine on rewritebase / rewritecond %{http_host} ^www.example.com$ [nc] rewriterule ^(.*)$ https://example.com/$1 [r=301,l] rewritecond %{the_request} \s/parts/([^\s]+)\s [nc] rewriterule ^ %1 [r=301,l] rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^(.+)$ /parts/$1 [l,qsa] rewritecond %{the_request} ^[a-z]{3,}\s([^.]+)\.php [nc] rewriterule ^ %1 [r,l] rewritecond %{request_filename} !-d rewritecond %{request_filename}.php -f rewriterule ^(.*?)/?$ $1.php [l] rewriterule ^toolbucket/([0-9]*)$ ./part.php?id=$1
any ideas?
because missing directory part
in rule. if want url example.com/toolbucket/part/1
replace
rewriterule ^toolbucket/([0-9]*)$ ./part.php?id=$1
with this.
rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^toolbucket/part/([0-9]*)/?$ /parts/toolbucket/part.php?id=$1 [l]
Comments
Post a Comment