En iyi yanıtlayıcılar
Küçük harfli URL

Soru
-
Yanıtlar
-
Global.asax;
protected void Application_BeginRequest(object sender, EventArgs e) { if (Regex.IsMatch(HttpContext.Current.Request.Url.ToString(), @"[A-Z]")) { String lower = HttpContext.Current.Request.Url.ToString().ToLower(); HttpContext.Current.Response.Clear(); HttpContext.Current.Response.Status = "301 Moved Permanently"; HttpContext.Current.Response.AddHeader("Location", lower); HttpContext.Current.Response.End(); } }
Hallettim. Teşekkürler ilgilendiğiniz için :)- Düzenleyen Rafet Topçu_ 1 Şubat 2015 Pazar 17:22
- Yanıt Olarak İşaretleyen Serkan Canseven 6 Şubat 2015 Cuma 07:53
Tüm Yanıtlar
-
-
-
Küçük harf istiyorsan küçük harfle yaz urlyi neden büyük yazıyosun ki? :P
www.mvcblog.org
e-mail: onay[nokta]yalciner[at]hotmail[nokta]com- Düzenleyen Önay YALÇINERModerator 1 Şubat 2015 Pazar 13:49
-
-
Sayfaları oluştururken hepsinin baş harfini büyük yazdım değiştirmeye üşeniyorum :D
Aslında güzel yoldasın. Bende senin yerine olsam bunu yapardım. MVC mi kullanıyorsun Form mu? Global.asax dosyanda bununla ilgili ayarları yapabilirsin. Routing yapılarına bak derim.
-
-
Global.asax;
protected void Application_BeginRequest(object sender, EventArgs e) { if (Regex.IsMatch(HttpContext.Current.Request.Url.ToString(), @"[A-Z]")) { String lower = HttpContext.Current.Request.Url.ToString().ToLower(); HttpContext.Current.Response.Clear(); HttpContext.Current.Response.Status = "301 Moved Permanently"; HttpContext.Current.Response.AddHeader("Location", lower); HttpContext.Current.Response.End(); } }
Hallettim. Teşekkürler ilgilendiğiniz için :)- Düzenleyen Rafet Topçu_ 1 Şubat 2015 Pazar 17:22
- Yanıt Olarak İşaretleyen Serkan Canseven 6 Şubat 2015 Cuma 07:53
-