routing

Heroku 403 Forbidden Error

强颜欢笑 提交于 2019-12-04 04:33:04
I deployed a PHP application and when I hit the url, I get the following error: Forbidden You don't have permission to access / on this server. I guess it tries to go into the app/ directory but it can't. My project structure: my-project | |-> app/ |-> public/ (index.php inside here that takes care of routing) Procfile composer.json etc. What the log shows: Jul 24 12:44:08 cryptic-beyond-39147 app/web.1: [Sun Jul 24 19:44:07.846582 2016] [autoindex:error] [pid 99:tid 139960748263168] [client 10.179.164.130:28253] AH01276: Cannot serve directory /app/: No matching DirectoryIndex (index.php

Laravel post route with url parameters

我们两清 提交于 2019-12-04 04:10:56
I'm facing a big wall of larval routing and I can't seem to find a solution I have this form in a view template <form url="/request/{{$equipment->url}}" method="POST"> <div class="row"> <div class="col-sm-4"> <div class="mt10">Start Date:</div> <input type="date" required name="starting_date" value="" placeholder="From" class="request-input request-date mb10"> </div> <div class="col-sm-4"> <div class="mt10">End Date:</div> <input type="date" required name="ending_date" value="" placeholder="To" class="request-input request-date mb10"> </div> <div class="col-sm-4"> <div class="mt10">Quantity<

How do you structure your URL routes?

自作多情 提交于 2019-12-04 03:56:42
Is there a specific pattern that developers generally follow? I never really gave it much thought before in my web applications, but the ASP.NET MVC routing engine pretty much forces you to at least take it into consideration. So far I've liked the controller/action/index structure (e.g. Products/Edit/1), but I'm struggling with more complex urls. For instance, let's say you have a page that lists all the products a user has in their account. How would you do it? Off the top of my head I can think of the following possibilities for a listing page and an edit page: User/{user id}/Products/List,

How do I get only the query string in a Rails route?

寵の児 提交于 2019-12-04 03:40:13
I am using a route like this match "/v1/:method" => "v1#index" My intention here is capture the name of the api method and then send the request to that method inside the controller. def index self.send params[:method], params end I figured this would send the other parameters as an argument to the method, but it didn't work. So my question is how can I pass the non-method parameters in a query string? #query_parameters does exactly what you want: request.query_parameters It's also the most efficient solution since it doesn't construct a new hash, like the other ones do. Stolen from the work

.NET MVC Routing w/ Url Encoding Problems

放肆的年华 提交于 2019-12-04 03:27:37
I have the following routing code: routes.MapRoute( "email-validated/{sessionId}", "email-validated/{sessionId}", new { controller = "User", action = "EmailValidated", sessionId = UrlParameter.Optional } ); When I hit the route w/ something that is url encoded it won't match the route for %2f, %2b and some other escaped characters. It also won't match for non url encoded (things w/ + etc) For instance This works: email-validated/XQiKC6KMM%2cmko4nOvzGRwPu9oaZFoCtXsFFJg3ZTf9S5rsBbLGjnz3FN3SJ0apEZcqK1PIcCY28mRMykB39XnFLKaL7390CDfLZiV77cso This doesn't work ( containts %2f etc): email-validated

What is the opposite of url_for in Rails? A function that takes a path and generates the interpreted route?

假装没事ソ 提交于 2019-12-04 03:17:40
Brain's a little fried....How do I get a hash of the :controller and :action from a relative_path? This is basically the opposite of url_for. in the example below, "some_function" is the mystery function name I'm looking for...I know it's easy, just can't remember or seem to be able to find it in the docs. Like so: some_function('/posts/1/edit') => {:controller => 'posts', :action => 'edit', :id => '1'} Rspec has a method 'params_for', which uses Action Controller's Routing Methods to parse paths with methods into routes. Theirs is a little more robust than this, but it boils down to: def

AngularJS routing hijacking non base URLs when page reload is expected

柔情痞子 提交于 2019-12-04 03:08:18
I'm building an AngularJS app that is not located in the root location domain.tld/blog . I have routing setup for everything on the /blog base. I included the base tag in the head of the page <base href="/blog"> . html5Mode is set to true . Within the app everything works as expected. However, when I click a non-angular URL outside of the base location the page isn't loaded. It seems that this location is caught by the otherwise function in the router: ROUTER.otherwise({ redirectTo : '/blog' }); So when I click any url, i.e. domain.tld/somewhere-else it redirects to domain.tld/blog. Obviously

Rails 3 Route with Multiple Optional Parameters

一世执手 提交于 2019-12-04 03:07:02
I am trying to create a Rails route that has optional parameters as well as varying order. This question describes a similar problem: Routes with multiple, optional, and pretty parameters I am trying to create routes that have map filters in them, like parameters but without the parameter URL styling. The idea is to have them look like /search/country/:country/ /search/country/:country/state/:state/ /search/country/:country/state/:state/loc/:lat/:long/ but you should also be able to search with /search/state/:state/ /search/state/:state/country/:country/ /search/loc/:lat/:long/ I know that I

How to include quote characters as a route parameter? Getting “Illegal characters in path” message

非 Y 不嫁゛ 提交于 2019-12-04 02:13:11
问题 I have a search box that exists on all pages. The user can enter text, and click search and they end up on the Search page with the results displayed for them. When search is clicked, the form containing the textbox is sent off to the following route: http://localhost:2010/search/my%20search%20term this works. But if I put quotes around the string, http://localhost:2010/search/%22my%20search%20term%22 This fails with the error message "Illegal characters in path". with the following stack

How do we identify parameters in a dynamic URL?

和自甴很熟 提交于 2019-12-04 02:04:13
问题 We are building a Rails CMS where a blog or news listing can appear anywhere in the site tree. This means that any page knows their type based on a database field - eg: a page knows that it is of type newslisting so once that URL is called for that page we need it to be processed by the newslistingcontroller. The subpages of the newslisting page are news stories - each with a date and category. The URL to the newslisting might be /dogs/snoopy-news/ and a news story might be /dogs/snoopy-news