.htaccess - Conversion from htaccess to rewrite issue -


i have moved site apache nginx , have got issue nginx.

htaccess

rewriteengine on   rewritecond %{request_uri} !\.(js|css|png|jpg|jpeg|bmp|ttf|php|php5|html|htm|gif)$ rewriterule ^(.+)/(.+[^/])/(.*[^/])/?$ index.php?p=$1&subp=$2&subsubp=$3 [qsa,l]  rewritecond %{request_uri} !\.(js|css|png|jpg|jpeg|bmp|ttf|php|php5|html|htm|gif)$ rewriterule ^(.+)/(.+[^/])/?$ index.php?p=$1&subp=$2 [qsa,l]  rewritecond %{request_uri} !\.(js|css|png|jpg|jpeg|bmp|ttf|php|php5|html|htm|gif)$ rewriterule ^(.*[^/])/?$ index.php?p=$1 [qsa,l] options -indexes 

and using converter nginx:

location ~ \.(js|css|png|jpg|jpeg|bmp|ttf|php|php5|html|htm|gif)$ { }  location ~ \.(js|css|png|jpg|jpeg|bmp|ttf|php|php5|html|htm|gif)$ { }  location ~ \.(js|css|png|jpg|jpeg|bmp|ttf|php|php5|html|htm|gif)$ { }  autoindex off;  location / { rewrite ^/(.+)/(.+[^/])/(.*[^/])/?$ /index.php?p=$1&subp=$2&subsubp=$3 break; rewrite ^/(.+)/(.+[^/])/?$ /index.php?p=$1&subp=$2 break;  rewrite ^/(.*[^/])/?$ /index.php?p=$1 break;  } 

i think that, can work when not talking subdomain.

yes - site in subdomain called /mysub/

so enter website use mysub.domain.com or domain.com/mysub/ (where first this:)

if ($http_host = "mysub.domain.com") {     rewrite ^(?!/\b(mysub|stats|error)\b)/(.*)$ /mysub/$2 ; } 

question:

how link these rules 1 ?


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -