routing

Symfony 2 - An error occurred while loading the web debug toolbar (404: Not Found)

喜你入骨 提交于 2019-11-28 07:07:38
问题 Since the update to symfony 2.2, the web debug toolbar is no longer loaded in app_dev.php. I get the following error: An error occurred while loading the web debug toolbar (404: Not Found). Do you want to open the profiler? In the prod.log I get the following: request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /_profiler/84fb75cc3ffd5435474ebe4250e01fac2cdf49c1"" at /httpdocs/project/app/cache/prod/classes.php line 3597

Laravel routes behind reverse proxy

馋奶兔 提交于 2019-11-28 07:01:59
Ok, so for development purposes, we have a dedicated web server. It's not currently connected directly to the internet, so I've setup an apache reverse proxy on another server, which forwards to the development server. This way, I can get web access to the server. The problem is, the routes in Laravel are now being prefixed with the internal server IP address, or the servers computer name. For example, I go to http://subdomain.test.com but all the routes, generated using the route() helper, are displaying the following url: http://10.47.32.22 and not http://subdomain.test.com . The reverse

Is it possible to call Express Router directly from code with a “fake” request?

半世苍凉 提交于 2019-11-28 06:55:50
Tangential to this question , I would like to find out if there is a way of triggering the Express Router without actually going through HTTP? The Router has a "private" method named handle that accepts a request, a response, and a callback. You can take a look at the tests that Express has for its Router . One example is: it('should support .use of other routers', function(done){ var router = new Router(); var another = new Router(); another.get('/bar', function(req, res){ res.end(); }); router.use('/foo', another); router.handle({ url: '/foo/bar', method: 'GET' }, { end: done }); }); The

Using HTML anchor link #id in Angular 6

为君一笑 提交于 2019-11-28 06:36:50
I am working with Angular 6 project in which I have disabled/removed hash-location-strategy which removes # from URL. due to this change the link having: <li routerLinkActive="active"> <a [routerLink]="['/settings']">Contact Settings</a> <ul class="child-link-sub"> <li> <a href="#contactTypes">Contact Types</a> </li> </ul> </li> is no more working it just skips current components URL and puts #contactTypes after localhost. I found this link which should solve the issue using <a [routerLink]="['/settings/']" fragment="contactTypes" >Contact Types</a> which puts #contactTypes at the end of the

Angular first site visit non-root path works locally but not in production

左心房为你撑大大i 提交于 2019-11-28 06:27:47
问题 In my Angular 4 application, if I type a non-root path into the url as my first visit to the site (i.e. localhost:4200/projects ), my application is bootstrapped and the correct component is rendered to the screen in the browser. However, once I serve the site through IIS, if I go to http://<my-domain>.com/projects , I get a 404 error (not from my application) and the application is never bootstrapped. How do I get a visit to a non-root path as the first visit to the site in production to

How to route a multiple language URL with a MVC

大憨熊 提交于 2019-11-28 06:24:51
I need multi-language URL route of existing controller. Let me explain more: I have a controller with name "Product" and View with name "Software"; therefore, by default if the user enters " http://example.com/en/Product/Software ", get right content (that really exists in http://example.com/Product/Software ), However, if another user -- a French user -- types " http://example.com/fr/Produits/logiciels ", must get above controller and show with right content (same http://example.com/Product/Software but with French text). Note: I set the route table with "{language}/{controller}/{action}/{id}

Paging and routing in ASP.Net MVC

一个人想着一个人 提交于 2019-11-28 06:24:07
问题 I am following Martijn Boland's 'Paging with ASP.NET MVC'. And while helpful it has raised a couple of issues I don't understand. Martijn says: Internally, the pager uses RouteTable.Routes.GetVirtualPath() to render the url’s so the page url’s can be configured via routing to create nice looking url’s like for example ‘/Categories/Shoes/Page/1′ instead of ‘/Paging/ViewByCategory?name=Shoes&page=1′. This is the is what he is talking about: private string GeneratePageLink(string linkText, int

angular: how to make link to jump for certain section in the same page

余生颓废 提交于 2019-11-28 06:18:56
问题 I want to an anchor link to jump to specific section in the same page using id hashtag. here is my html: <div class="nav-container"> <ul class="nav text-center"> <li class="active"> <a href="#account-services">Services</a> </li> <li> <a [routerLink]="['//account/'+account.account_id]" fragment="account-about">About</a> </li> <li> <a href="#account-gallery">Gallery</a> </li> <li> <a href="#account-reviews">Reviews</a> </li> </ul> </div> <div class="account-details"> <div id="account-services">

ASP.NET MVC, localized routes and the default language for the user

萝らか妹 提交于 2019-11-28 06:03:53
I am using ASP.NET MVC localized routes. So when a user goes to the English site it is example.com/en/Controller/Action and the Swedish site is example.com/sv/Controller/Action . How do I make sure that when a user enters the site he/she comes to the correct language directly? I do know how to get the language I want, that is not the issue. The thing I used to do is that I put that culture into the RegisterRoutes method. But because my page is in integrated mode I cannot get the request from Application_Start. So how should I make sure that the route is correct right from the beginning? This

ASP.NET MVC Routing with Default Controller

心不动则不痛 提交于 2019-11-28 06:01:08
For a scenario, I have a ASP.NET MVC application with URLs that look like the following: http://example.com/Customer/List http://example.com/Customer/List/Page/2 http://example.com/Customer/List http://example.com/Customer/View/8372 http://example.com/Customer/Search/foo/Page/5 These URLs are achieved with following routes in Global.asax.cs routes.MapRoute( "CustomerSearch" , "Customer/Search/{query}/Page/{page}" , new { controller = "Customer", action = "Search" } ); routes.MapRoute( "CustomerGeneric" , "Customer/{action}/{id}/Page/{page}" , new { controller = "Customer" } ); //-- Default