Karem
Karem

Reputation: 18103

URL rewrite, getting error

I am having this in a .htaccess:

RewriteEngine On 
RewriteRule ^videos/([0-9]+)/?$ vis_film.php?id=$1 [NC,L]

My page is root/directory/directory/videos/vis_film.php?id=2

but i want it to be

root/directory/directory/videos/2/

And ive placed the .htaccess file inside videos/, is that right? and what have i done wrong?

Upvotes: 1

Views: 68

Answers (2)

casraf
casraf

Reputation: 21694

You need to put it in the 2nd directory (root/directory/directory/videos/)

Upvotes: 0

Gumbo
Gumbo

Reputation: 655299

If you’re already in videos/, you need to remove that path prefix from your pattern:

RewriteRule ^([0-9]+)/?$ vis_film.php?id=$1 [NC,L]

Upvotes: 1

Related Questions