Sponsored Content
Full Discussion: Need help with rewrite rule
Top Forums Web Development Need help with rewrite rule Post 302459957 by BSrikanthB on Tuesday 5th of October 2010 05:05:49 PM
Old 10-05-2010
Need help with rewrite rule

Hi,

I hosted my site on Apache web server.
I wanted to redirect all the users request to a HTML page(maintenance page).
I used the below rewrite rule to do ths same.

Code:
RewriteEngine on
RewriteRule .* /maintenance.html

The maintenance.html page contains an image.
When ever I try to access my site(during maintenance),I am being redirected to the maintenance.html page.But, I am unable to see the image.
Any help would be grateful.....

Thanks,
Srikanth Bodakunta
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How do I rewrite to use a while instead of find?

for FILE in `find /home/Upload/*` Need to use a while instead to prevent errors when the file is emptied (4 Replies)
Discussion started by: goodmis
4 Replies

2. Shell Programming and Scripting

grep help, how do i rewrite this

Thanks , franklin you method worked, i knew i had to use a while loop and getline in there just didnt know the proper order :) Hi everyone, im trying to make the following command line shorter by introducing a script that join up all the grep commands ./new1a < numbers.txt | grep -i -v '^a '... (5 Replies)
Discussion started by: weezybaby
5 Replies

3. UNIX for Dummies Questions & Answers

rewrite date

I'm looking to have function that takes the present month and rewrites it into this form: _06_ (june), _09_ (september), and so on.. I would like this to be a my $this_month=code that rewrites date function because I would like to be a able to call it multiple times in the script by writing... (5 Replies)
Discussion started by: marringi
5 Replies

4. Web Development

.htaccess Rewrite Rule

Hello All, I have been asked to create a .htaccess redirect. I have never attempted to work with one of these files. We have a pretty vanilla LAMP setup using rhel4 apache1.3 and php4.2.3. I was instructed to place the .htaccess file in the document root of the site and and to attempt to... (1 Reply)
Discussion started by: jaysunn
1 Replies

5. UNIX for Advanced & Expert Users

Apache rewrite rule help needed

Hi All, I want to redirect from http://localhost/abc/xyz/def?cc=dk&lc=da to http://localhost/abc/mnc/pdf?cc=dk&lc=da. Please suggest a rewrite rule. (0 Replies)
Discussion started by: jagnikam
0 Replies

6. UNIX for Advanced & Expert Users

[SOLVED] htaccess rewrite rule help!

hi there, I need that when user input mysite.com/ponuka/AAA2869 it shows mysite.com/ukaz.php?ponuka=AAA2869 because of facebook likes, and I found out that this is set up as rewrite rule in .htaccess file? how to achieve it? thank you... :confused: ---------- Post updated at 04:47... (0 Replies)
Discussion started by: vogueestylee
0 Replies

7. Web Development

Rewrite Rule looping error

Hi, I have a domain "test.example.com" and i wanted to redirect only request like "test.example.com /index.html" to "test.example.com/index.html?NEW=1". Please note that a extra string "?NEW=1" added at the end of the URL. So Request for http://test.example.com/index.html REDIRECTS TO... (12 Replies)
Discussion started by: Paulwintech
12 Replies

8. Web Development

ReWrite rule giving a hard time.

Hi all, I am trying to find a rewrite rule that can help me with the following situation. So I am currently on a page which has a URL: http://www.test.mobile.com/#!/shop/phones/max-plus/features/ Now when I hover over a certain link, I can see that it will goto: <a... (0 Replies)
Discussion started by: Junaid Subhani
0 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 03:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy