Hey!
Does anyone know how to create rewrite rules to change:
“link.html?hl=en” to “/en/link.html”
“link.html?hl=jp” to “/jp/link.html”
“link.html?hl=es” to “/es/link.html”
etc?
Where "link.html" changes based on the page request? (2 Replies)
Hi,
I am new to Apache but I have requirement as follows.
if the url is http://images/data1/templates/ it should redirect to http:/172.20.224.23/templates/
if the url doesn't have "data1/templates" (mean http://images/) it should redirect to http://images:8080/.
I tried as below
... (3 Replies)
I did a fresh install of nginx on a debian server.
When I check the version of nginx, it reports 0.7.67
However, the current stable version of Nginx is 1.0.5 from what I have read.
How can I update my Nginx whilst leaving my server operational?
I am a relative newb, so please do... (1 Reply)
Hi,
Looking for a shell script to redirect the below URLS...
1) http://domain.site.com/exmp/http://www.example.com/ofxm/supp/un_headfoot?un_head=yes redirects to http://domain.site.com/header.html
2) http://domain.site.com/exmp/http://www.example.com/ofxm/supp/un_headfoot?un_foot=yes... (4 Replies)
Hi ,
I installed NGINX and when i i go see the browser it says
welcome If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
is there any kind of document to configure that(i am completly new for this) (1 Reply)
Here is my issue:
I have two web servers hosting web services (Server A and Server B)
I'd like to configure NGINX to achieve load balancing.
Do I install NGINX on a third new server, or is it something that gets installed on Server A and Server B?
Please share some information.
... (0 Replies)
hi
By the command yum install nginx
Want a security modules Security modules such as virtual hosts I apply
Do you know a quick solution?
thanks (0 Replies)
I've SSH installed a Python 3.5 application on CentOS along with uwsgi and nginx, but after doing a sudo vi /etc/nginx/nginx.conf to edit the nginx config file as per usual, the response is currently:
nginx: bind() to 0.0.0.0:80 failed (98: Address already in use)
these are the contents of... (0 Replies)
Discussion started by: dev5180
0 Replies
LEARN ABOUT PHP
yaf_router
YAF_ROUTER(3) 1 YAF_ROUTER(3)The Yaf_Router classINTRODUCTION
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)