Search Results

Search found 20409 results on 817 pages for 'url routing'.

Page 25/817 | < Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >

  • Nested routing in Ruby on Rails

    - by vooD
    My model class is: class Category < ActiveRecord::Base acts_as_nested_set has_many :children, :foreign_key => "parent_id", :class_name => 'Category' belongs_to :parent, :foreign_key => "parent_id", :class_name => 'Category' end def to_param slug end Is it possible to have such recursive route like this: /root_category_slug/child_category_slug/child_of_a_child_category_slug ... and so one Thank you for any help :)

    Read the article

  • Calcualting Optimal Site to Site Routing using pre-computed times between sites

    - by Idistic
    Assume that I have a number of sites (locations) and the time it takes to travel from each site to each site is pre-computed Example Data - Site to Site Pre-Calculated Times in minutes From Start Site To A 20 To B 15 To C 15 From Site A To B 10 To C 15 Site B To A 10 To C 20 Site C To A 15 To B 20 4 Sites is fairly simple, but what if the site set was say 1000 sites? Given a large site set What would the best approach be to quickly find the optimal routes from the start site while visiting every other site just once? Route Solutions from Start Site for 3 sites from a start site 1 A(20) B(10) C(20) = 50 2 A(20) C(15) B(20) = 55 3 B(15) A(10) C(15) = 40 4 B(15) C(20) A(15) = 50 5 C(15) A(15) B(10) = 40 6 C(15) B(20) A(10) = 45

    Read the article

  • Using Routing helpers in a Rake task

    - by trobrock
    I have a rake task that sends out the next 'x' invitations to join a beta it uses this code: desc "This will send out the next batch of invites for the beta" task :send_invites => :environment do limit = ENV['limit'] c = 0 invitation = Invitation.all(:conditions => { :sent_at => nil, :sender_id => nil }, :limit => limit).each do |i| Mailer.deliver_invitation(i, register_url(i.token)) c.increment! end puts "Sent #{c} invitations." end I need to pass in the 'register_url' to the Mailer in order for the link to show up in the email, but since this is running from a rake task and not from a request it does not have a access to the helper methods. What is the best way of achieving this?

    Read the article

  • nginx: rewrite URL but have original URL stored in access.log as 200

    - by mhambra
    I'm setting up a link tracking system, which (temporarily) involves adding /link/id/ in front of URL (like http://server/data/id/publication/id/). rewrite data/id/(.*) http://server/$1; The request is logged as: ip - - [17/Nov/2011:10:07:19 +0300] "GET /data/id/publication/id.html HTTP/1.1" 302 154 "-" "UA"` For some reason (keeping the compatibility with AWStats) it is wanted to have 200 logged instead of 302. (nginx allows to get 301 code out of box with permanent option, but thats inappropriate too) What are my options here? Will the combination of location { } and rewrite do the job?

    Read the article

  • routing problem with startpage in rails3

    - by DannyRe
    Hey, I deleted the Index.html in my /public/ folder. I added a "application" folder in my views. In it I put a new index.html.erb. This I want to be my startpage/homepage. In my new "index.html.erb" I set: link_to 'sign in', {:controller => 'devise/sessions', :action => 'new'} But it redirects me to the "application#index". I set root :to => "application#index How can I set this to route it to "posts#index" after I sign in, for example? Is there a chance to use .erb oder .haml in my /public/index.html? Many thanks!!

    Read the article

  • Routing problem, handling differently online versus local - MVC.net 1.0

    - by VinnyG
    I have there lines in my RegisterToutes : routes.MapRoute("Pages3", "{url1}/{url2}/{url3}", MVC.Page.RedirectTo(), new { url1 = "", url2 = "", url3 = "" }); routes.MapRoute("Pages2", "{url1}/{url2}", MVC.Page.RedirectTo(), new { url1 = "", url2 = "", url3 = "" }); routes.MapRoute("Pages1", "{url1}", MVC.Page.RedirectTo(), new { url1 = "", url2 = "", url3 = "" }); On my local machine and on my demo server (demo.myserver.com/myproject/) it works great for handling the 404, but live(www.mysite.com) it just go to the IIS 404. I have a PageController witch go see if the page exist in the DB and if it don't I return to a 404 view with the status code 404 (Response.StatusCode = 404;) How can I reproduce the same behavior live? Do I need to setup something on IIS? I'm on winserver 2008 using c# and MVC 1.0. Thanks for the help!

    Read the article

  • WCF Endpoint routing

    - by Dmitriy Sosunov
    Hi, Guys, how to route inbound message between different endpoints. I need to expose the single endpoint that could accept different credentials. I guess, solve this by intercept the incoming message and based on message header then do forward message to appropriate endpoint. Thanks.

    Read the article

  • Routing to a different URLs based on post type

    - by DanCake
    What would be the best way to set up my routes so different types of posts have different URLs? For example, regular posts are /posts/slug while featured posts are /featured/slug Both link to the same controller and action /posts/view/slug. I experimented with different ways of doing this but with little success. Currently my link params look something like the following: array('controller' => 'posts', 'action' => 'view', 'featured' ,$post['Post']['slug'])

    Read the article

  • Sinatra Routing Exceptions

    - by Ethan Turkeltaub
    I want to be able to do the following: get '/:slug' do haml :page end get '/administration' do haml :admin end Is there a way that I can have get '/:slug' do have an exception for /administration? I realize you can do this with if else statements: get '/:slug' do if params[:slug] == 'administration' haml :admin else haml :page end end But that isn't very clean looking. Is there a way to have an exception to routes?

    Read the article

  • prefix routing cakephp

    - by nick martin
    Hello, Just a quick one.. I am unsure how to prevent a prefix, for example if I am in domain.com/admin/orders or domain.com/user/order which are admin_ and user_ actions and the navigation menu contains links to pages displays (controller pages action display, **) when they are clicked on they are automatically prefixed by the current prefix. How can I set in the router file to redirect wildcards prefixes (ie. /pages/)?

    Read the article

  • CodeIgniter URI routing (dynamic, multilingual)

    - by koteko
    I'm trying to redirect all routs to one main controller. Here is my routes.php $route['default_controller'] = "main"; $route['scaffolding_trigger'] = ""; //$route['(\w{2})/(.*)'] = '$2'; //$route['(\w{2})'] = $route['default_controller']; $route['(en|ge)/(:any)'] = $route['default_controller']."/index/$1"; $route['(:any)'] = $route['default_controller']."/index/$1"; I need language id to be passed with every link (like: http://site.com/en/hello-world) Here is my main controller: class Main extends Controller { function __construct() { parent::Controller(); } function index($page_type=false, $param=false) { die($page_type.' | '.$param.'| Aaa!'); } } I want to check if predefined file type exists (like: http://site.com/en/archive/05-06-2010 - here predefined type would be archive) then do something. If not then search in the database for slug. If not found then go to 404. The problem is that I can't get index function parameters ($page_type, $param). Thanks for help.

    Read the article

  • Can someone explain Kohana 3's routing system?

    - by alex
    In bootstrap.php, where you set routes, I'm having a hard time getting them to work. I read some documentation a while ago that I can't seem to find again that explains them. Here is one of my examples Route::set('products', 'products/(type)', array('type' => '.+')) ->defaults(array( 'controller' => 'articles', 'action' => 'view_product', 'page' => 'shock-absorbers', )); I thought that would mean a request like products/something would load up the articles controller, and the action_view_product method. But I can't get it to work. Can someone please explain to me exactly how they work, and what all the method parameters are?

    Read the article

  • Rails 3 - routing

    - by akam
    I don't know how to make a link_to because I'dont have a nouveau_message_path in rake routes rake routes : GET /nouveau_message/.:id {:action=>"nouveau_message", :controller=>"messages"} routes.rb : controller :messages do get 'nouveau_message/.:id' => :nouveau_message end What is the best way to make a link_to to nouveau_message from another view ? Thanks

    Read the article

  • Static page routing in Sinatra (Ruby)

    - by JP
    You can serve static files with Sinatra by placing them in public/ (by default) -- I have an index.html in there at the moment, but how can I make the root point to that file without having to parse it as a template? To be clear, I can access /index.html successfully, and I'd like to route / to be the same static file, but without redirecting. Any idea how to do this?

    Read the article

  • IIS redirect url for virtual directory

    - by Jouni
    Hello, How i can set redirect url for virtual directory in iis 7.0.I have installed lates url rewrite module 2. ? I could explain my problem with exsample. I have website on my iis 7.0 server: www.mysite.com I desided to create virtual directory sales under my site which is pointing to website root directory.Now I need create redirect url for the vdir. The vdir is pointing same virtual root directory as my site root is The big idea is that i can write on browser www.mysite/sales and i will automaticly redirect to url www.mysite.com?productid=200. I tried to make redirect with rewite url for vdir(not website), but I always get this error message : cannot add duplicate colletion entry of type 'rule' with unique key key attribute 'name' set to "test".This happens when i am pointing for virtual vdir and try to add rule. I can add rules to website level,but rules doesn work. I mean url www.mysite/sales gives me follwing error. I know that key is unique I checked it from web.config. This kind of feature was really easy use in IIS 6.0, just point vdir with your mouse and set properties--a redirect to url. Please some one explain what is right way to do it in IIS 7.0

    Read the article

  • Kohana 3.2 useradmin routing issue

    - by user1789926
    I am new to kohana and am developing a simple application that is using the useradmin module from http://blog.mixu.net. I am having, what I think, an understanding problem. At present the action_index redirects to user/profile when a non admin user logs in. I want to go to a controller called home instead. I want to redirect to home/index.php I have tried simply changing the redirect and this does not work. I am suspecting I need to do something with routes to get me to home/index but I can not work out what I should be doing. I would really appreciate it if someone could steer me in the right direction here.

    Read the article

  • MVC ActionLink generating NON-Restul URL AFTER adding constraints

    - by brianstewey
    Hello I have a custom route that without constraints generates a Restful URL with an ActionLink. Route - routes.MapRoute( "Blog", // Route name "Blog/{d}/{m}/{y}", // URL with parameters, new { controller = "Blog", action = "Retrieve" } Generates - http://localhost:2875/Blog/12/1/2010 From - <%=Html.ActionLink("Blog Entry - 12/01/2010", "Retrieve", "Blog", new { d = 12, m = 01, y = 2010 }, null)%> If I add constraints like so. routes.MapRoute( "Blog", // Route name "Blog/{d}/{m}/{y}", // URL with parameters, new { controller = "Blog", action = "Retrieve" }, new { d = @"\d{2}", m = @"\d{2}", y = @"\d{4}" } It generates - http://localhost:2875/Blog/Retrieve?d=12&m=1&y=2010 Extra information: it is added before the custom route. Any ideas? Cheers

    Read the article

  • Weird Rails URL issue when rendering a new action

    - by Tony
    I am rendering a new action but somehow getting the "index" URL. To be more specific, my create action looks like this: class ListingsController < ApplicationController def create @listing = Listing.new(params[:listing]) @listing.user = @current_user if @listing.save redirect_to @listing else flash[:error] = "There were errors" render :action => "new" end end end When there are errors, I get the "new" action but my URL is the index URL - http://domain.com/listings Anyone know why this would happen? My routes file is fairly standard: map.connect 'listings/send_message', :controller => 'listings', :action => 'send_message' map.resources :listings map.root :controller => "listings" map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format'

    Read the article

  • Including a Django app's url.py is resulting in a 404

    - by 828
    I have the following code in the urls.py in mysite project. /mysite/urls.py from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^gallery/$', include('mysite.gallery.urls')), ) This results in a 404 page when I try to access a url set in gallery/urls.py. /mysite/gallery/urls.py from django.conf.urls.defaults import * urlpatterns = patterns('', (r'^gallery/browse/$', 'mysite.gallery.views.browse'), (r'^gallery/photo/$', 'mysite.gallery.views.photo'), ) 404 error Using the URLconf defined in mysite.urls, Django tried these URL patterns, in this order: ^gallery/$ The current URL, gallery/browse/, didn't match any of these. Also, the site is hosted on a media temple (dv) server and using mod_wsgi

    Read the article

  • URL Mapping prefix in Grails

    - by Furuno
    Recently, I'm trying to migrating my application from CakePHP to Grails. So far it's been a smooth sailing, everything I can do with CakePHP, I can do it with much less code in Grails. However, I have one question : In CakePHP, there's an URL Prefix feature that enables you to give prefix to a certain action url, for example, if I have these actions in my controller : PostController admin_add admin_edit admin_delete I can simply access it from the URL : mysite/admin/post/add mysite/admin/post/edit/1 mysite/admin/post/delete/2 instead of: mysite/post/admin_add mysite/post/admin_edit/1 mysite/post/admin_delete/2 Is there anyway to do this in Grails, or at least alternative of doing this?

    Read the article

  • Drupal with clean urls turned on is putting question marks in URL

    - by aussiegeek
    I have a drupal site with clean urls, the pages load correctly, but then the URL is rewritten with a question mark in it, which I don't want the user to see. My .htaccess is: <IfModule mod_rewrite.c> RewriteEngine on # If your site can be accessed both with and without the 'www.' prefix, you # can use one of the following settings to redirect users to your preferred # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option: # # To redirect all users to access the site WITH the 'www.' prefix, # (http://example.com/... will be redirected to http://www.example.com/...) # adapt and uncomment the following: # RewriteCond %{HTTP_HOST} ^example\.com$ [NC] # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] # # To redirect all users to access the site WITHOUT the 'www.' prefix, # (http://www.example.com/... will be redirected to http://example.com/...) # uncomment and adapt the following: # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301] # Modify the RewriteBase if you are using Drupal in a subdirectory or in a # VirtualDocumentRoot and the rewrite rules are not working properly. # For example if your site is at http://example.com/drupal uncomment and # modify the following line: # RewriteBase /drupal # # If your site is running in a VirtualDocumentRoot at http://example.com/, # uncomment the following line: RewriteBase / # Rewrite URLs of the form 'x' to the form 'index.php?q=x'. RewriteCond %{REQUEST_URI} !(connect|administration) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] </IfModule>

    Read the article

  • IIS URL Rewrite HTTP to HTTPS with Port

    - by Andy Arismendi
    My website has two bindings: 1000 and 1443 (port 80/443 are in use by another website on the same IIS instance). Port 1000 is HTTP, port 1443 is HTTPS. What I want to do is redirect any incoming request using "htt p://server:1000" to "htt ps://server:1443". I'm playing around with IIS 7 rewrite module 2.0 but I'm banging my head against the wall. Any insight is appreciated! BTW the rewrite configuration below works great with a site that has an HTTP binding on port 80 and HTTPS binding on port 443, but it doesn't work with my ports. P.S. My URLs intentionally have spaces because the 'spam prevention mechanism' kicked in. For some reason google login doesn't work anymore so I had to create an OpenID account (No Script could be the culprit). I'm not sure how to get XML to display nicely so I added spaces after the opening brackets. < ?xml version="1.0" encoding="utf-8"? < configuration < system.webServer < rewrite < rules < rule name="HTTP to HTTPS redirect" stopProcessing="true" < match url="(.*)" / < conditions trackAllCaptures="true" < add input="{HTTPS}" pattern="off" / < /conditions < action type="Redirect" redirectType="Found" url="htt ps: // {HTTP_HOST}/{R:1}" / < /rule < /rules < /rewrite < /system.webServer < /configuration

    Read the article

  • Map a URL bought with Dreamhost to Amazon EC2 (AWS)

    - by Edan Maor
    I have several URLs I purchased through Dreamhost. I'm starting to use Amazon's AWS, and I'd like to map the URLs to Amazon. This is something of a silly question, and I've already done the same thing several times to other services (mapping from Dreamhost to WebFaction). But for some reason when I tried to find the proper way to do the same mapping to Amazon, I find a lot of detailed writing talking about whether I should be using CNAME or A records, etc. So I wanted to ask in the simplest possible terms and hopefully get a simple, concrete answer: I bought a URL from Dreamhost, I have an EC2 server running on AWS (to which I already mapped an Elastic IP address). How do I make the URL map to AWS? And if there are several options, which one should I effectively be using? P.S. Meta-question - why are things so much more difficult with AWS? When I search Google for "Move from Dreamhost to WebFaction, I get very simple answers on how to do the mapping. In what way is AWS different?

    Read the article

  • Using Computer name in URL causes issues when connecting to Web Services

    - by AWinters
    The set of applications I work on all access the same 8 or so web services that we have. These services and applications all reside on the same box and all use the computer name when trying to connect to the web service. For Example: If I have a web service called MapDataService and I have an application that accesses it, it would access it by the URL: http://COMPUTERNAME/MapDataService/MapDataService.asmx. This works in most of the applications that access the web service. However, we have several applications that, when using the computer name in the URL, will not get data returned from the service (actually a 503 is returned). In order to get it to work, the IP address of the system needs to be used in place of the COMPUTERNAME. This strikes me as very odd considering, as I mentioned before, all applications and services are on the same box and most other applications usr the COMPUTERNAME with no issues. Can someone give me some insight as to what could be causing this? We have no access to IIS logs and what logs we did get (this is on a customer site) are not very useful.

    Read the article

< Previous Page | 21 22 23 24 25 26 27 28 29 30 31 32  | Next Page >