Jump to content

Allowing special characters in URL rewrite rule


adrianTNT

Recommended Posts

Hello.

I want to have a photo album URL that looks like this:

 

/pictures/christmas-pictures-1020/christmas-lights-234.html

 

That is album title - album id / photo title - photo id ^.

 

My current rule:

RewriteRule ^pictures/(.*)-([0-9]+)/(.*)-([0-9]+).html$ ...

 

I want to allow special characters in these titles, characters like ţîş that is why the (.*) but I assume this is not right because any_character can also be a slash.

I tried to replace (.*) with [a-zA-Z] but that one does't include special characters ?!

What would be the solution? Maybe I can just add a condition where title can be any char but not "/", if this is a good solution then how do I write this "not slash" condition ?

 

Thank you.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.