Jayabal
Jayabal

Reputation: 1

.htaccess url rewriting is not working it shows 404 error

I have URL like this example.com/post/second.php?id=10

I need a URL like this example.com/post/second/10

I'm trying to create .htaccess file in /post/ folder and domain root folder but nothing is working.

My .htaccess code:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^second/([0-9]+)$ /second.php?id=$1 [L]

Upvotes: 0

Views: 93

Answers (1)

jacouh
jacouh

Reputation: 8741

You might try this in /post/.htaccess, as you have only file /post/second.php, but not /second.php as you call in your accessFile:

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^second/([0-9]+)$ second.php?id=$1 [L]

Upvotes: 1

Related Questions