0

I'm trying to make CodeIgniter with special character:

somepage.com/something#somethingelse

Definition in routes.php is:

$route['(:any)#(:any)'] = 'eshop/eshop/individual/$1/$2';

but it throws me error:

Message: preg_match(): Unknown modifier '('

Do you have any experience with this? Thank you

Jan Kožušník
  • 683
  • 3
  • 16
  • 30
  • is first (:any) for $1 and second (:any) (after #) for $2 ..? – Rishi Shrivastava Jan 19 '15 at 10:22
  • Browser will not sent any request after # in url. So, technically this is an invalid routing request. [This](http://stackoverflow.com/a/5971826/2627842) can be a help. You can only achieve this one using javascript. – Ariful Haque Jan 19 '15 at 10:27
  • Yeah, I'm trying to do it via JavaScript. Anytime, what if I want to use instead of **# ?** ? I'm using CodeIgniter and there is problem, it won't laod string after **?** – Jan Kožušník Jan 19 '15 at 10:32

1 Answers1

0

Only:

$route['(:any)'] = 'eshop/eshop/individual/$1';

After in Javascript:

var hash = window.location.hash.substr(1);
rigobcastro
  • 1,258
  • 11
  • 18