routing

CodeIgniter - Remove “Index” From URL

ⅰ亾dé卋堺 提交于 2019-11-29 13:45:49
NOTE: I'm not talking about removing index.php - I mean index - the method name. My current URL looks like this: www.mysite.com/view-topic/index/my-topic This is what I want it to look like: wwww.mysite.com/view-topic/my-topic How would I go about doing this? Thanks in advance! You can set up the routes for this, in application/config/routes.php , add a new line: $route['view-topic/(:any)'] = 'view-topic/index/$1'; This will route your URL http://url.com/view-topic/anythinggoeshere will mask the view-topic/index/anythinggoeshere controller. More information on routing: Routing with Codeigniter

nodejs hapi single page

不羁岁月 提交于 2019-11-29 13:39:23
问题 I have a single app site (NodeJS) and I want to migrate from Express to Hapi, what I normally do is serve static files and route everything else to a single page which contains the angularjs app and the angular routing configuration. // Express routing, first the static files app.use( express.static(__dirname + '/public') ); // Second the api routes app.get('/api', function(req, res){ res.send( {api: 'response' } ) }); // Finally everything else maps to the single page app: app.get('*',

Using AngularJS routing and loading controllers on demand using requirejs

可紊 提交于 2019-11-29 13:31:41
问题 I'm trying to use AngularJS and RequireJS in combination. I would like to use the $routeProvider service and avoid having to load all the controllers for my views on application startup. For that, I tried the following: define(['require', 'angular', 'appModule'], function (require, angular, app) { app.config(['$routeProvider', function($routeProvider) { $routeProvider .when('/sites', {templateUrl: '/Site/GetSitesView', controller: function() { require(['sitesController'], function

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

允我心安 提交于 2019-11-29 13:13:54
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 [] [] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception

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

最后都变了- 提交于 2019-11-29 12:48:53
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"> <h1>services</h1> </div> <div id="account-about"> <h1>About Us</h1> </div> <div id="account-store">

Symfony2 Use default locale in routing (one URL for one language)

大兔子大兔子 提交于 2019-11-29 12:48:49
问题 I am currently developing a website with Symfony2 and I need to translate it. With tools provided by Symfony2 it’s very easy. But I encounter a problem: I would like to have specific URL (with prefix) to a language (ie, one URL, a single language), but with a default language. Concretely: Assume that the default language is English, so http://example.com/fr/hello display the page in French http://example.com/it/hello display the page in Italian http://example.com/en/hello redirect to http:/

How can I pass data with URLs to ui-sref?

喜夏-厌秋 提交于 2019-11-29 12:48:43
I ny view I have: <a ui-sref="app.file({path: file.path})">{{ file.path }}</a> file.path is html/hero-sidebar.html My state is defined as: .state('app.file', { url: '/file/*path' views: repositoryView: templateUrl: '/templates/app/_file.html' }) But when I click the link, it goes to http://localhost:9001/app/file/html%252Fhero-sidebar.html What I want is for it to go to http://localhost:9001/app/file/html/hero-sidebar.html Is this possible using ui-router with AngularJS? There is already logged issue in ui-router Github , you could found it here In order to solve this you need to add this code

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

爱⌒轻易说出口 提交于 2019-11-29 12:37:08
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 recognize that the application is an Angular application and bootstrap the application for any path that

ASP.NET MVC Remove query string in action method

别说谁变了你拦得住时间么 提交于 2019-11-29 12:17:01
问题 I have an action method that looks like this: public ActionResult Index(string message) { if (message != null) { ViewBag.Message = message; } return View(); } What happens is that the url of a request to this will look like: www.mysite.com/controller/?message=Hello%20world But I want it to look just www.mysite.com/controller/ Is there a way to remove the query string inside the actionmethod? 回答1: No, unless you use a POST method, the information has to get passed somehow. An alternative may

Meteor infinite redirect instead of render 404

我的梦境 提交于 2019-11-29 11:56:37
I have a simple iron-router config in my /lib/router.coffee: Router.configure notFoundTemplate: "notFound" Router.map -> @route "app", path: "/" template: "app" When entering on / it's works, but if I try go to /abc then it redirects me at /#!abc, after that it redirects me at /abc and so repeated endlessly (I see these changes in the address bar of a browser, in the browser log redirection from / to /abc and back). I never see a 404 error. Has anyone encountered such behavior? I use Meteor v1.0.2.1. There is my meteor list: alethes:lodash 0.7.1 appcache 1.0.3 coffeescript 1.0.5 ground