Welcome! Log In Create A New Profile

Advanced

location regex for processing php extension less files

Posted by nginx_newbie 
location regex for processing php extension less files
March 22, 2012 09:50AM
Dear Nginx Forum Members,

I wish to implement the following which is working perfectly under Apache. This is being done for better SEO of the URLs.

Example URLS:
http://www.astrogyan.com/enter/indian_astrology_horoscope_chart_prediction.html
http://www.astrogyan.com/register/free_astrology_member_sign_up.html
http://www.astrogyan.com/sitemap/indian_horoscope_astrology_chart_site_map.html
http://www.astrogyan.com/know_your_gemstone/gID-7/sani_planet_saturn_gemstone_blue_sapphire_neelam.html

In all the above URLs "enter", "register", "sitemap", "know_your_gemstone" are all PHP scripts and what follows them are dummy file names generated by PHP for SEO rankings. Actually "indian_astrology_horoscope_chart_prediction.html" file name does not exist. In Apache, I use
the following:

DefaultType application/x-httpd-php

In the last of the above URL, "gID-7" is used to pass a variable to the script to show appropriate content. While this URL is showing DYNAMIC
content, the URL is so crafted that is looks like a STATIC URL which can be indexed by search engines easily.

I need to know how best can this be implemented under NGINX?

I have a VPS running ubuntu where I have installed nginx with php-fpm and for normal URL's like index.htm / index.php the setup is working fine.
I am not a pro in regex writing hence I am stuck up at this juncture. I searched online under many nginx blogs / forum but could not find the right
solution.

Any help on this will be most appreciated. Thanks in advance...

Regards
Ganesh
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 188
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready