I need .htaccess
rule to reroute:
example.com/view-post.php?id=40
to example.com/article/40
So browser shows example.com/article/40
in address bar but server uses example.com/view-post.php?id=40
I need .htaccess
rule to reroute:
example.com/view-post.php?id=40
to example.com/article/40
So browser shows example.com/article/40
in address bar but server uses example.com/view-post.php?id=40
The following works:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^article/(d+)*$ ./view-post.php?id=$1
Refer: https://code.tutsplus.com/tutorials/using-htaccess-files-for-pretty-urls--net-6049