我应该在URL中允许“。”吗?

I am doing URL masking by using codeigniter routing. Here I allow user to enter a text which will be URL of his offer details on under a specific URL.

ie,if user entered "offer1" then his offer details will be available on

offers.com/offer/offer1

Here I accept only alphabets and numbers as URL text.Should I allow "." in URL text? What is the standard method should I follow here?

When user enters the offer name take that as $offer_name and encode it using base64_encode($offer_name);

$encoded_name = base64_encode($offer_name);

Send this $encoded_name to url...........and if you want to use offer name further decode it using base64_decode($encoded_name);

if you need the "." you can leave that in urls, if you then use url params to run queries just escape params before to run the query.

Usually i make a 301 redirect to the base_url(); if somenthing wrong with url params.

just my 2 cents

You can allow "." in URL by adding "." in $config['permitted_uri_chars'] config variable in config.php.