nginx clean url with seo friendly file names

0 votes

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

Example URLS:

https://www.edureka.co/masters-program/automation-testing-engineer-training
https://www.edureka.co/selenium-certification-training

What I am exactly looking forward to is a location regex to catch all extension-less php scripts in the ROOT FOLDER ONLY for processing by php-fptm.

In all the above URLs "enter", "know_your_gemstone" are all PHP scripts and what follows them are dummy file names generated by PHP for SEO. Actually "indian_astrology_horoscope_chart_prediction.html" file name does not exist. In Apache, I use the following which intercepts "enter / know_your_gemstone" etc and never bothers about the rest of the file name:

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. This variable parsing is done in PHP already and has nothing to do with Nginx. I beleive this part is already referred as pretty url / clean url.

I need to know how best can this be implemented under NGINX? I need the regex to process all scripts (extension less files) in ROOT FOLDER and ignore what follows after such script names. If such a file does not exist, then consider to check the rest of the URL hoping it to be a valid directory followed by a file name. This directory portion is optional and not essential to my present needs.

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.

I am using the latest development version of Nginx v1.1.17 with php v5.3.6.13. I have also compiled additional modules like more header, cache purge, memcache etc.

Mar 2, 2022 in Digital Marketing by Kichu
• 19,040 points
742 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Digital Marketing

0 votes
0 answers

SEO Friendly URL

 I'm creating a blog where i want ...READ MORE

Mar 3, 2022 in Digital Marketing by Kichu
• 19,040 points
380 views
0 votes
0 answers

.htaccess give 404 Not Found when url in SEO-friendly URL

Im using opencart fresh install and using ...READ MORE

Mar 4, 2022 in Digital Marketing by Kichu
• 19,040 points
1,156 views
0 votes
0 answers

Wordpress Plug-ins: How-to add custom SEO friendly URL Handles

I was wondering if its possible to ...READ MORE

Mar 5, 2022 in Digital Marketing by Kichu
• 19,040 points
651 views
0 votes
0 answers

Producing SEO friendly URL in javascript

I have a PHP function that converts ...READ MORE

Mar 5, 2022 in Digital Marketing by Kichu
• 19,040 points
655 views
0 votes
0 answers

Replacement of parameters in seo url with htaccess

My url: x.com/ara?il=istanbul&ilce=avcilar&marka=opel&model=corsa x.com/rent/istanbul-avcilar-opel-corsa In htaccess: RewriteRule ^rent/([0-9a-zA-Z-_]+)-([0-9a-zA-Z-_]+)-([0-9a-zA-Z-_]+)-([0-9a-zA-Z-_]+)$ ara.php?il=$1&ilce=$2&marka=$3&model=$4 [L,QSA] it does ...READ MORE

Mar 8, 2022 in Digital Marketing by Kichu
• 19,040 points
1,315 views
0 votes
1 answer

Joomla "No input file specified" also with SEO disabled

The solution is pretty simple. You are ...READ MORE

answered Mar 11, 2022 in Digital Marketing by narikkadan
• 63,600 points
818 views
+1 vote
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,059 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP