views:

43

answers:

1

Hi, ` I'm having some troubles with url rewrites in htaccess.

I have all my PHP pages in subfolder /pages.

These are my urls:
http://www.example/tickets
http://www.example/en/tickets
http://www.example/fr/tickets
http://www.example/nl/tickets

--> all these should point to /pages/tickets.php

Currently I use this in htaccess:

RewriteRule ^(nl|fr|en)/tickets /pages/tickets.php [L]

The urls WITH language string work but when I ommit the language string I get a 404 error.

How can I solve this?

Thanks, Nick

A: 

You could use this rule to remove the language identifier for all following rules:

RewriteRule ^(nl|fr|en)/(.*) $1

Or, if you just want it to be optional for this single rule:

RewriteRule ^((nl|fr|en)/)?tickets$ /pages/tickets.php [L]
Gumbo