Membership Membership:
Latest New User Latest: vpros
Past 24 Hours Past 24 Hours: 0
Prev. 24 Hours Prev. 24 Hours: 0
User Count Overall: 137

People Online People Online:
Visitors Visitors: 53
Members Members: 0
Total Total: 53

NakedMCSE Computer Tech Support Forums

So you have passed all of the exams and you are now out in the real world of windows servers, linux servers and freebsd servers faced with a tech support problem you have never seen before...

Find free online tech support in the forums below, respecting that advice is free, but work beyond advice is not...

The General forum is provided for off topic discussion.

You need a user account to post - please Register or Login.

Online Tech Support Forums
 
  Forum  Open Source Tec...  NGINX Server  SEO URL Rewrite using NGINX rewrite rule URL redirect
Previous Previous
 
Next Disabled
New Post 3/26/2011 12:14 AM
Informative
  Walker
119 posts
www.lairdscomputer.com
10th Level Poster


SEO URL Rewrite using NGINX rewrite rule URL redirect 

 NGINX can implement rewrite rule for SEO just like apache.  This allows you to url redirect a client from one URL that is easy for search engines to find and index, to a back end url that is easy to program.

There are two ways to do this in the NGINX configuration file, that both amount to the same thing, but have a different syntax.  First you could use the if statement to test to see if the target of the URL does not exist and then rewrite:

if(! -e $request_filename ){
    rewrite ^(.*)$ /index.php?_route_=$1 last;
    break;
    }

Or you could redirect error page 404 to the rewrite rule:

error_page 404 =200 @seo;

location @seo {
    rewrite ^(.*)$ /index.php?_route_=$1 last;
    break;
    }

Obviously the content of the rewrite rule itself will vary depending on your URL structure.

Walker

 
Previous Previous
 
Next Disabled
  Forum  Open Source Tec...  NGINX Server  SEO URL Rewrite using NGINX rewrite rule URL redirect
Send me One Million FREE Guaranteed Visitors