php - Rewrite Rule in .htaccess not working With MAC OS -
hi friends wrote rewrite rule website in php, working fine windows , linux os moved project mac osx @ time goes error , not rewrite properly
the .htaccess file code given below
rewriteengine on rewritebase /projectname rewriterule uploads/(.*) uploads/$1 [l] rewriterule css/(.*) css/$1 [l] rewriterule libs/(.*) libs/$1 [l] rewriterule js/(.*) js/$1 [l] rewriterule images/(.*) images/$1 [l] rewriterule files/(.*) files/$1 [l] rewriterule api/(.*) api/$1 [l] rewritecond %{request_filename} !-f rewritecond %{request_uri} !example.php rewritecond %{request_uri} !(.*)/$ rewriterule (.*)$ index.php?module=$1 [l] rewriterule (.*)/(.*)$ index.php?module=$1&action=$2 [l] rewriterule (.*)/(.*)/(.*)$ index.php?module=$1&action=$2&id=$3 [l]
required side
thanx guyzzz...
no idea how got work on os last set of rules never applied.
first, 3 conditions ever applied following rule, rewriterule (.*)$ index.php?module=$1 [l]
. means last 2 rules have no conditions, happens ok because never used anyways. rewriterule (.*)$ index.php?module=$1 [l]
rule's pattern matches , last 2 rules redundant. you're after is:
rewritecond %{request_filename} !-f rewritecond %{request_uri} !example.php rewritecond %{request_uri} !(.*)/$ rewriterule (.*)/(.*)/(.*)$ index.php?module=$1&action=$2&id=$3 [l] rewritecond %{request_filename} !-f rewritecond %{request_uri} !example.php rewritecond %{request_uri} !(.*)/$ rewriterule (.*)/(.*)$ index.php?module=$1&action=$2 [l] rewritecond %{request_filename} !-f rewritecond %{request_uri} !example.php rewritecond %{request_uri} !(.*)/$ rewriterule (.*)$ index.php?module=$1 [l]
Comments
Post a Comment