I have the following folder structure in my website:
example.com/
reports/
causelist/
final_causelist.php
I have a link / URL to the final_causelist.php page is as:
http://example.com/reports/causelist/final_causelist.php?wb_sno=23&dated=2020-10-26&j_names=Mr.+ABC
I want to access the page like the following:
http://example.com/23/2020-10-26/Mr.+ABC
For the above, I created .htaccess in the causelist folder with the following code:
RewriteEngine on
RewriteBase /reports/causelist/
Options -Indexes
RewriteRule ^(d+)/([a-z-]+)/(.+)/$ /final_causelist.php?wb_sno=$1&dated=$2&j_names=$3 [L,B]
But it does not show the page and complaint that the requesting page is not found on this server?
2
Answers
Your regex is not matching
date
part correctly and you must remove leading/
from target as you’re using aRewriteBase
.Could you please try following.