9 More Discussions You Might Find Interesting
1. Web Development
I hope someone can help. I somewhat know what a mod_rewrite does which is URL rewiring. What I don't know is how to make the mod_rewrite to handle paths ?
Can this be why an AngularJS file is not being loaded ? (36 Replies)
Discussion started by: MaxtheCat
36 Replies
2. Web Development
Hello,
I have added following rewrite cond and rewrite rules but it does not work.
RewriteCond %{HTTP_REFERER} ^http://192\.168\.1\.150/categories/.*$
RewriteRule ^(.*)$ http://www.blahblah.com/
When I hit url : http://192.168.1.150/categories/881-Goes?page=7 in my browser - it... (2 Replies)
Discussion started by: ashokvpp
2 Replies
3. UNIX for Advanced & Expert Users
Hi Folks,
I am running on a CentOS 6.3 server, whose primary function until recently has been my Zimbra mail server exclusively. I added wordpress and I have not been disappointed, with this one exception of Apache mod_rewrite. I have already tried to set selinux to permisive to eliminate that... (5 Replies)
Discussion started by: cjm51213
5 Replies
4. Web Development
Hi Team,
I have a question on the apache mod_rewrite module. I have a requirement of rewriting only specific url's to https.
Requirement below:-
want to match a word (test) on the url and if matches then it should rewrite to https.
example:-
... (1 Reply)
Discussion started by: arumon
1 Replies
5. Web Development
Hi, I have problems with mod rewrite. I will try to describe...
I want clean urls but fail to make it work propperly. Maybe I have problems, because the content displayed is fetched from my other site...
There is a lot of stuff I already red about this, but somehow I can not find a solution... (2 Replies)
Discussion started by: lowmaster
2 Replies
6. Shell Programming and Scripting
I have to redirect
http://www.domain.com/(*)/(*)-hotel-deals.html
to
http://www.domain.com/(*)/(*)-hotel-deals
where of course (*) are dynamic.
Any ideas how this could be accomplished? (0 Replies)
Discussion started by: EXT3FSCK
0 Replies
7. Web Development
I'd like to translate a friendly url such as:
http://www.xxxyyyzzz.com/page/12345678/
to:
http://www.xxxyyyzzz.com/page/12/34/56/78/
Seems simple enough, but I cannot figure out how. Any one done this before? (2 Replies)
Discussion started by: markericksen
2 Replies
8. Web Development
Here's my situation.
When a user access the site domain.com it redirects to /portal which displays SKIN1 by default.
When a user accesses the site domain.com/portal?branding=SKIN1 it displays SKIN1 by default as well.
When a user access the site domain.com/portal?branding=SKIN2 it... (0 Replies)
Discussion started by: Adrnalnrsh
0 Replies
9. Web Development
In my strenuous efforts to get SEO-friendly urls, I'm using a rewrite map in my apache setup:
RewriteEngine on
RewriteOptions MaxRedirects=5
RewriteMap seo prg:/Applications/MAMP/htdocs/map.php
#map requests for the original file to the new SEO friendly urls
RewriteCond... (0 Replies)
Discussion started by: sneakyimp
0 Replies
LEARN ABOUT PHP
yaf_router
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)