2

I Have an Arabic site and I put it on tow servers:-

first one :- http://mvis.com.eg/3neza/ar

it works fine put when I uploaded it on its server client server:-unaizh.com

it have a problem with news links when you click on news link in the news bar under the slider it gives you Bad Request - Invalid URL and the URL become a wrong link like this:- http://unaizh.com/en/news/details/��������������-���

Islam Zedan
  • 656
  • 4
  • 21

1 Answers1

1

Bad requests can be thrown at multiple stages

Various parts of your server/app can throw Bad Request responses to the client. To find out how to solve them, you first have to recognize them. In your case, the Bad Request error generated by Code Igniter has a bit of styling and specifically mentions The URI you submitted has disallowed characters.. The Bad Request error generated by the webserver just returns Bad Request - Invalid URL.

Fix bad request errors on the app level

CodeIgniter by default only allows a subset of characters to be in the URI. If you want to change that behavior, look into /system/application/config/config.php. There is a $config['permitted_uri_chars'] variable. By default it'll look like $config['permitted_uri_chars'] = 'a-z 0-9~%.:&_\-'; . You can change it to an empty string. That will solve your problem, but it's not secure.

Related: Codeigniter Redirect -- The URI you submitted has disallowed characters

Fix bad request errors on the server level

You have to find out what triggers the error. Consult your error log, and if it does not return anything useful, turn on debugging. First guesses for this error could be the URL being too long or that the server has to be configured to accept (certain) multibyte characters. As this issue is no longer related to programming but to configuring a web server, further advice should be sought at ServerFault.

Community
  • 1
  • 1
Bjorn
  • 5,272
  • 1
  • 24
  • 35
  • thank you the answer ,but this don't solve my problem and the site is working fine on the first server http://mvis.com.eg/3neza/ar and it is lunix server but when I uploaded it to the another server unaizh.com and it is windows server – Islam Zedan Jan 04 '15 at 16:41
  • I get the error on mis.com.eg as well; f.e. open this url: `http://mvis.com.eg/3neza/ar/news/details/نشاط-طالبات-عنيزة-يكرم-المدراس-الفائزة-بجائزة-(-فينا-خير-)%E2%80%8E` – Bjorn Jan 04 '15 at 16:42
  • The other 400 Bad Request error I'm getting is generated by the webserver, `Microsoft-HTTPAPI/2.0`. This could have various reasons like the URL being to long or it could be that the URL contains invalid characters. Please consult the error logs of the server or turn on debugging. This error is not programming but server related, so if you need any extra help, consult the serverfault network. – Bjorn Jan 04 '15 at 16:51
  • thank you I will contact with server owner and check with them the problem – Islam Zedan Jan 05 '15 at 08:18