Sponsored Content
Full Discussion: Default PHP Sites
Top Forums Web Development Default PHP Sites Post 302829307 by Corona688 on Thursday 4th of July 2013 01:27:47 PM
Old 07-04-2013
What if there really is a file named 'index'? What if there's a directory named 'index'? What happens when you have both an index.php and index.html, which wins, which loses?

You can use rewrite rules to change something without an extension into .php, but I don't know a way to make it know which one you really wanted.
 

5 More Discussions You Might Find Interesting

1. Programming

sites with the listings

Is anybody know sites with the listings of simple programs for Linux (in text mode) (0 Replies)
Discussion started by: Studenttt
0 Replies

2. Post Here to Contact Site Administrators and Moderators

Sites flash

The flash you have placed in the header of the site is really really cool.. But it makes your machine lag, and its really big for ppl connecting with low speeds.. And thinking that you know this already, why dont you just make it a bit smaller? (5 Replies)
Discussion started by: binary_w0lf
5 Replies

3. UNIX for Dummies Questions & Answers

exam prep sites ?

iam going to study for mcse , ccna and ocp in my next couple of month and i was looking for sites with package deals .... i came across hotcerts.com . anyone knows how good is their $85 all exams package and is it worth it ???? . looking for ur responses (0 Replies)
Discussion started by: kelipukal
0 Replies

4. Shell Programming and Scripting

Where are my sites hosted?

I have 5 public websites (2 different datacenters) 1. production datacenter 2. Backup datacenter. I have a global site selector which will load balance the site based on availability and load. I would like to have a script that can tell me exactly where my sites are in 2 columns. ... (2 Replies)
Discussion started by: kmaq7621
2 Replies

5. Red Hat

Web sites

Hi, I can't view web portal in my intranet from linux RHE, and neither to web application. My network configuration /etc/sysconfig/network-scripts/fcfg-eth0 is ok, what is happen?, can you help me please. (2 Replies)
Discussion started by: xochitl
2 Replies
YAF_ROUTER(3)								 1							     YAF_ROUTER(3)

The Yaf_Router class

INTRODUCTION
Yaf_Router is the standard framework router. Routing is the process of taking a URI endpoint (that part of the URI which comes after the base URI: see Yaf_Request_Abstract::setBaseUri) and decomposing it into parameters to determine which module, controller, and action of that controller should receive the request. This values of the module, controller, action and other parameters are packaged into a Yaf_Request_Abstract object which is then processed by Yaf_Dispatcher. Routing occurs only once: when the request is initially received and before the first controller is dispatched. Yaf_Router is designed to allow for mod_rewrite-like functionality using pure PHP structures. It is very loosely based on Ruby on Rails routing and does not require any prior knowledge of webserver URL rewriting. It is designed to work with a single Apache mod_rewrite rule (one of): Example #1 Rewrite rule for Apache RewriteEngine on RewriteRule !.(js|ico|gif|jpg|png|css|html)$ index.php or (preferred): Example #2 Rewrite rule for Apache RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L] If using Lighttpd, the following rewrite rule is valid: Example #3 Rewrite rule for Lighttpd url.rewrite-once = ( ".*?(.*)$" => "/index.php?$1", ".*.(js|ico|gif|jpg|png|css|html)$" => "$0", "" => "/index.php" ) If using Nginx, use the following rewrite rule: Example #4 Rewrite rule for Nginx server { listen ****; server_name yourdomain.com; root document_root; index index.php index.html; if (!-e $request_filename) { rewrite ^/(.*) /index.php/$1 last; } } DEFAULT ROUTE
Yaf_Router comes preconfigured with a default route Yaf_Route_Static, which will match URIs in the shape of controller/action. Addition- ally, a module name may be specified as the first path element, allowing URIs of the form module/controller/action. Finally, it will also match any additional parameters appended to the URI by default - controller/action/var1/value1/var2/value2. Note Module name must be defined in config, considering application.module="Index,Foo,Bar", in this case, only index, foo and bar can be considerd as a module name. if doesn't config, there is only one module named "Index". Some examples of how such routes are matched: Example #5 Yaf_Route_Static(default route)example // Assuming the following configure: $conf = array( "application" => array( "modules" => "Index,Blog", ), ); Controller only: http://example/news controller == news Action only(when defined yaf.action_prefer=1 in php.ini) action == news Invalid module maps to controller name: http://example/foo controller == foo Module + controller: http://example/blog/archive module == blog controller == archive Module + controller + action: http://example/blog/archive/list module == blog controller == archive action == list Module + controller + action + params: http://example/blog/archive/list/sort/alpha/date/desc module == blog controller == archive action == list sort == alpha date == desc CLASS SYNOPSIS
Yaf_Router Yaf_Router Properties o protected$_routes o protected$_current Methods o public bool Yaf_Router::addConfig (Yaf_Config_Abstract $config) o public bool Yaf_Router::addRoute (string $name, Yaf_Route_Abstract $route) o public Yaf_Router::__construct (void ) o public string Yaf_Router::getCurrentRoute (void ) o public Yaf_Route_Interface Yaf_Router::getRoute (string $name) o public mixed Yaf_Router::getRoutes (void ) o public bool Yaf_Router::route (Yaf_Request_Abstract $request) PROPERTIES
o $_routes - registered routes stack o $_current - after routing phase, this indicated the name of which route is used to route current request. you can get this name by Yaf_Router::getCurrentRoute. PHP Documentation Group YAF_ROUTER(3)
All times are GMT -4. The time now is 06:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy