Find Jobs
Hire Freelancers

htaccess to nginx conversion - Error [emerg] invalid variable name

$10-30 USD

In Progress
Posted over 9 years ago

$10-30 USD

Paid on delivery
I want to do htaccess to nginx conversion of the following code, i used following auto formatter to do the translation however i get a error as below, i dont know why and how to fix this issue. can you please help Url i used to convert [login to view URL] Error i get Invalid nginx configuration: nginx: [emerg] invalid variable name in /var/www/vhosts/system/[login to view URL]:12 nginx: configuration file /etc/nginx/[login to view URL] test failed .htacess code ModPagespeed on Options -indexes AddOutputFilterByType DEFLATE text/html text/plain text/xml # BEGIN Rewrite <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^[login to view URL] RewriteRule (.*) [login to view URL]$1 [R=301,L] RewriteCond %{THE_REQUEST} \s/+(?:index\.php)?\?search=([^\s&]+) [NC] RewriteRule ^ /%1/? [R=302,L,NE] ## replace of space with - # executes **repeatedly** as long as there are more than 1 spaces in URI RewriteRule "^(\S*) +(\S* .*)$" /$1-$2 [L,NE] # executes when there is exactly 1 space in URI RewriteRule "^(\S*) (\S*)$" /$1-$2? [L,R=302,NE] RewriteRule ^search/([^/]+)/page/([^/]+)$ [login to view URL]$1&page=$2 RewriteRule ^ads/css/([^/]+)$ ads/css/$1 RewriteRule ^ads/images/([^/]+)$ ads/images/$1 [QSA,L] RewriteRule ^adwords/admin/([^/]+)$ adwords/admin/$1 [L] RewriteRule ^adwords/([^/]+)$ adwords/$1 [L] RewriteRule ^images/([^/]+)$ images/$1 [QSA,L] RewriteRule ^images/([^/]+)/([^/]+)$ images/$1/$2 [QSA,L] RewriteRule ^ajax/([^/]+)$ ajax/$1 [QSA,L] RewriteRule ^info/([^/]+)$ info/$1 [QSA,L] RewriteRule ^css/([^/]+)$ css/$1 [QSA,L] RewriteRule ^css/([^/]+)/([^/]+)$ css/$1/$2 [QSA,L] RewriteRule ^includes/([^/]+)$ includes/$1 [QSA,L] RewriteRule ^includes/([^/]+)/([^/]+)$ includes/$1/$2 [QSA,L] # if a directory or a file exists, use it directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/?$ ?search=$1 [QSA,L] </IfModule> # END Rewrite nginx code when i converted the values using above link is if ($http_host ~ "^[login to view URL]"){ set $rule_0 1$rule_0; } if ($rule_0 = "1"){ rewrite /(.*) [login to view URL]$1 permanent; } #ignored: condition 0 if ($rule_1 = "1"){ rewrite ^/ /$bref_1/? redirect; } rewrite /"^(S*) /+(S*; rewrite /"^(S*) /(S*)$"; rewrite ^/search/([^/]+)/page/([^/]+)$ /[login to view URL]$1&page=$2; rewrite ^/ads/css/([^/]+)$ /ads/css/$1; rewrite ^/ads/images/([^/]+)$ /ads/images/$1 last; rewrite ^/adwords/admin/([^/]+)$ /adwords/admin/$1 last; rewrite ^/adwords/([^/]+)$ /adwords/$1 last; rewrite ^/images/([^/]+)$ /images/$1 last; rewrite ^/images/([^/]+)/([^/]+)$ /images/$1/$2 last; rewrite ^/ajax/([^/]+)$ /ajax/$1 last; rewrite ^/info/([^/]+)$ /info/$1 last; rewrite ^/css/([^/]+)$ /css/$1 last; rewrite ^/css/([^/]+)/([^/]+)$ /css/$1/$2 last; rewrite ^/includes/([^/]+)$ /includes/$1 last; rewrite ^/includes/([^/]+)/([^/]+)$ /includes/$1/$2 last; if (!-f $request_filename){ set $rule_17 1$rule_17; } if (!-d $request_filename){ set $rule_17 2$rule_17; } if ($rule_17 = "21"){ rewrite ^/([^/]+)/?$ /?search=$1 last; }
Project ID: 6937497

About the project

4 proposals
Remote project
Active 9 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
4 freelancers are bidding on average $24 USD for this job
User Avatar
Hello, i have sorted your error & rewrite the sections that are irrelevant. Please message me so we assign project & exchange files. Will provide support if necessary, thanks. Best regards
$20 USD in 1 day
5.0 (20 reviews)
4.2
4.2
User Avatar
Hi there , This is James , I'm having the expertise and experience respective to your project. will configure the htaccess rule correctly . Be advice there is need less than 15 for this project . Looking forward for hearing from you . Thanks in advance James C
$10 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of AUSTRALIA
Sydney, Australia
4.9
63
Payment method verified
Member since Sep 13, 2008

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.