Reputation: 39
For my work portfolio i am using htaccess for seo friendly URL and its working fine for all but for two projects its not working and going to another page (rs.php) and redirecting to home page.
Site is https://www.rsseosolution.com/seo-work-portfolio.php
At this page all projects are opening fine but Number 4 (Fair Price Movers) and number 11 (New Hampshire Lawyers) ..... these two are not opening while URL and process is same.
page name is case-studies.php
I tried by add "echo and die option" at starting of page
echo "Testing value is coming on not"; die();
But as i said that its going to another page rs.php
Using htaccess as below for our portfolio project details at case-studies.php
Options +FollowSymLinks
RewriteEngine on
RewriteRule case-studies/(.*)-(.*)\.php$ case-studies.php?project=$1&id=$2
RewriteRule package/(.*)-(.*)\.php$ package.php?name=$1&id=$2
RewriteRule rs-(.*)\.php$ rs.php?cid=$1
I am not getting that why only two projects URL is going to rs.php.
What am i missing? If need any other details then please let me know.
Hope for quick response.
Upvotes: 2
Views: 37
Reputation: 980
The error happen in this url fair-price-movers-164
as it contain rs-164
which will match the last rule.
You need to add [L] at the end of each rule to stop matching.
Options +FollowSymLinks
RewriteEngine on
RewriteRule case-studies/(.*)-(.*)\.php$ case-studies.php?project=$1&id=$2 [L]
RewriteRule package/(.*)-(.*)\.php$ package.php?name=$1&id=$2 [L]
RewriteRule rs-(.*)\.php$ rs.php?cid=$1 [L]
Upvotes: 1