1

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?

2 Answers 2

1

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]
3
  • I still get 500 server error.. on the whole videos/ directory.. i tried videos/2 and videos/vis_film.php?id=2 but i just get 500 internal server error
    – Karem
    Feb 26, 2010 at 18:40
  • @Azzyh: Maybe you’re not allowed to use a .htaccess there. What does the error log say?
    – Gumbo
    Feb 26, 2010 at 18:41
  • I dont know how to access the error log.. I will need to ask the admin of the server
    – Karem
    Feb 26, 2010 at 18:47
0

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

1
  • I still get 500 server error.. on the whole videos/ directory.. i tried videos/2 and videos/vis_film.php?id=2 but i just get 500 internal server error
    – Karem
    Feb 26, 2010 at 18:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.