Jms Bnd
Jms Bnd

Reputation: 1253

Special Characters break Generated URLs

I have an automated process which generates urls from the title of venue.

I then use the following line to within my .htaccess to get the url to redirect to the correct path

RewriteRule ^recipes/([\w-]+)/(\d+)$  ./recipes_news.php?i=$2 [L,QSA]

a typical URL looks like the link below

www.site.com/recipes/red-curry-chicken/123

Where the last part of the url is the id used to find the actual recipe information.

For some reason unknown to me, anytime a special character such as "ā" occurs, it breaks the url.

Is there something I am missing in the .htaccess code to capture special chacters?

Thanks

Upvotes: 0

Views: 145

Answers (1)

Jon Lin
Jon Lin

Reputation: 143966

Try changing your regex pattern to:

RewriteRule ^recipes/([^/]+)/(\d+)$  ./recipes_news.php?i=$2 [L,QSA]

Upvotes: 1

Related Questions