Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

nginx rewrites


CRBAman

Recommended Posts

Posted

oscommerce nginx rewrite rules nginx.conf fastcgi php

 

 

I have write it, maybe it will be helpful for someone in future :)

 

 

############################

rewrite ^(.*)p-(.*).html$ "/product_info.php?products_id=$2&%{QUERY_STRING}";

rewrite ^(.*)p-(.*)/osCsid/(.*) /product_info.php?products_id=$2;

rewrite ^(.*)c-(.*).html$ "/index.php?cPath=$2&%{QUERY_STRING}";

rewrite ^(.*)m-([0-9]+).html$ "/index.php?manufacturers_id=$2&%{QUERY_STRING}";

rewrite ^(.*)pi-([0-9]+).html$ "/popup_image.php?pID=$2&%{QUERY_STRING}";

rewrite ^(.*)t-([0-9]+).html$ "/articles.php?tPath=$2&%{QUERY_STRING}";

rewrite ^(.*)a-([0-9]+).html$ "/article_info.php?articles_id=$2&%{QUERY_STRING}";

rewrite ^(.*)pr-([0-9]+).html$ "/product_reviews.php?products_id=$2&%{QUERY_STRING}";

rewrite ^(.*)pri-([0-9]+).html$ "/product_reviews_info.php?products_id=$2&%{QUERY_STRING}";

rewrite ^(.*)i-([0-9]+).html$ "/information.php?info_id=$2&%{QUERY_STRING}";

rewrite ^/nfl_gear_products.html$ /advanced_search_result.php?searchbar=1&keywords=NFL+Gear&searchType=all[R=301,L];

rewrite index.php/cPath/(.+) /index.php?cPath=$1;

rewrite product_info.php/products_id/(.+) /product_info.php?products_id=$1;

rewrite product_reviews_info.php/products_id/(.+)/reviews_id/(.+) /product_reviews_info.php?products_id=$1&reviews_id=$2;

rewrite product_info.php/cPath/(.+)/products_id/(.+) /product_info.php?cPath=$1&products_id=$2;

############################

 

insert this code after

 

 

###################

location / {

index index.php;

root /path/to/dir

###################

 

 

use hyperhosting.com.ua - they helps me with it, and they hosts my oscommerce site with nginx+fastcgi php

Posted

And dont forget about this line when you are using PHP as the fastcgi backend:

 

 

###################

location ~ ^(.+\.php)(.*)$ {

fastcgi_split_path_info ^(.+\.php)(.*)$;

fastcgi_pass php;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME /path/to/dir$fastcgi_script_name;

 

fastcgi_param QUERY_STRING $query_string;

fastcgi_param REQUEST_METHOD $request_method;

fastcgi_param CONTENT_TYPE $content_type;

fastcgi_param CONTENT_LENGTH $content_length;

 

fastcgi_param SCRIPT_NAME $fastcgi_script_name;

fastcgi_param REQUEST_URI $request_uri;

fastcgi_param DOCUMENT_URI $document_uri;

fastcgi_param DOCUMENT_ROOT $document_root;

fastcgi_param SERVER_PROTOCOL $server_protocol;

 

fastcgi_param GATEWAY_INTERFACE CGI/1.1;

fastcgi_param SERVER_SOFTWARE nginx;

 

fastcgi_param REMOTE_ADDR $remote_addr;

fastcgi_param REMOTE_PORT $remote_port;

fastcgi_param SERVER_ADDR $server_addr;

fastcgi_param SERVER_PORT $server_port;

fastcgi_param SERVER_NAME $server_name;

fastcgi_param HTTP_USER_AGENT $http_user_agent;

##############################

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...