Welcome to HostingForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

mod_rewrite

 
   Web Hosting Problem Solving Community! (Home) -> Apache RSS
Next:  Domain name transfer question  
Author Message
CptDondo

External


Since: Jul 04, 2005
Posts: 11



(Msg. 1) Posted: Wed Feb 27, 2008 2:05 pm
Post subject: mod_rewrite
Archived from groups: alt>apache>configuration (more info?)

I'm using a client side redirect that I would like to change to server
side. Right now I am using this bit of php to redirect if the user agent
is not lftp.

<?php
$ref = $_SERVER["HTTP_USER_AGENT"];
if (strncmp($ref,"lftp",4) != 0) {
header( "Location: http://new.location.com/some/page" );
}
exit( 0 );
?>

What I would like is to to redirect everything coming from outside my lan
(192.168.128.0/24) , wan (10.10.0.0./16), and not using lftp. I want it
to work for any subdirectory as well.

I've included this in my vritual host file but it doesn't work; I still
get indexes if I go directly to the images directory or to any
subdirectories below it.

<Location /blog/Travels/images/>
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^192\.168\.128\.*
RewriteCond %{REMOTE_ADDR} !^10\.10\.*
RewriteCond %{HTTP_USER_AGENT} !^lftp*
RewriteRule .* /blog/Travels
</Location>

 >> Stay informed about: mod_rewrite 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
mod_rewrite example? - I've been looking through the mod_rewrite info from here: http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule I still dont understand how to make something like the following: www.blah.com/aaa/bbb/ccc.xxx Get rewritten to say:..

help please about mod_rewrite - Hello...i needed suggestions about to redirect all user requesting something like www.mysite.it/en/page.php to www.mysite.it/uk/page.php using an .htacces file with the following code but it doesn't work! Can anyone help me? file .htacces contents >&...

mod_rewrite directory - Hi, I am using mod_rewrite to re-direct all requests to a directory to a .php script using a set of commands similar to: RewriteEngine on RewriteRule !\.(gif|jpg|png|css)$ ../some_dir/handler.php [T=application/x-httpd-php] These reside within a..

Mod_rewrite Problems - Hey All, I am running a Fedora Core 3 server, with Apache/2.0.53 and PHP/ 4.3.11, with each user having their own folder under the server (ie '/ home/userOne/public_html' = 'server.com/~userOne') I am trying to get the mod_rewrite module to work for me...

mod_rewrite on AppServ - I am using: AppServ 2.5.9 (Apache 2.2.4 PHP 5.2.3 MySQL 5.0.45 phpMyAdmin-2.10.2) CakePHP 1.1.19.6305 I need to configure Apache to use pretty URLs like: www.example.com/controllername/actionname/param The CakePHP manual says: "Make sure that...
   Web Hosting Problem Solving Community! (Home) -> Apache All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]