Some problems with mod_rewrite module

This is a discussion on Some problems with mod_rewrite module within the Apache Web Server forums, part of the Web Server and Related Forums category; I have read a documentation of mod_rewrite module, I have started a few tests and I have a few problems ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-17-2007
zimi
 
Posts: n/a
Default Some problems with mod_rewrite module

I have read a documentation of mod_rewrite module, I have started a
few tests and I have a few problems
Firstly, I couldn't set environment variable, that is to say if I set
environment variable in mod_rewrite, I can't get it in PHP
..htaccess
RewriteRule (.*) ind.php [E=A:ble]

ind.php
<?
echo'<pre>';
print_r($_ENV);
?>
I haven't the $_ENV['A']

Is this normal? or maybe I do sth wrong?

Secondly, I can't use -x in my mod_rewrite, for example:

RewriteCond path/to/the/file.ext -x

As far as I know this condition should be executed when some file have
chmod 777 or something, but I change this attribute and nothing
happens

Thirdly, I discovered something, I have some URL: http://www.example.com/sth17
and a rule in .htaccess

RewriteRule ^([a-z\.]+) index.php?$1

in index.php I print $_GET and I get one key in this array without any
value, this key is [index_php]
when I change my rule to

RewriteRule ^([a-z\.]+)([0-9]+) index.php?$1=$2

I get:

[sth] => 17

but I have found nowhere information about behaviour like this

4. I want to rewrite url like this:
http://www.subdomain.example.com/path/to/file.ext
to
http://www.example.com/subdomain/path/to/file.ext

I try with .htaccess like this
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.zawi\.dreamhosters\.com$
RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.zawi\.dreamhosters\.com$
RewriteRule .* %2%{REQUEST_URI}

when I delete %{REQUEST_URI} everything is fine, and the url
http://subdomain.example.com/ is rewrited to http://example.com/subdomain/,
but when I leave it I get ERROR 500 Misconfiguration server or sth
like that

5. I found somewhere code like that

RewriteCond %{HTTP_HOST}<>%{REQUEST URI} condition_in_regexp

but I can't find nowhere what does it mean <>

thank you in advance

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 07:40 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0