You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tim <tf...@netfactoriel.com> on 2003/04/15 11:53:56 UTC
[users@httpd] Mod rewrite question
hi,
i'm running under windows 2K, and Apache 2. in my httpd.conf, in my root <Directory> i'm using this:
RewriteEngine on
RewriteRule ^(.*).html$ 404.html [QSA,L]
i don't want anyone to view the html pages. this works fine exept when i try to put it in an .htaccess
if i do this, the directory becomes inaccessable. what am i doing wrong?
any help would be grand
Thanks
Tim
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Mod rewrite question
Posted by André Malo <nd...@perlig.de>.
* Tim wrote:
>> - What does "root"-<Directory> mean in this context?
>> - You're missing a RewriteBase directive.
>
> in my main httpd.conf i have
> ...
> DocumentRoot "C:/Program Files/BigApache/Apache/htdocs"
> ...
> <Directory "C:/Program Files/BigApache/Apache/htdocs">
> AllowOverride AuthConfig
> Options Indexes FollowSymLinks Includes
> Order allow,deny
> Allow from all
> AddHandler type-map var
> AddHandler server-parsed .html
> DirectoryIndex index.asp index.html.var index.php index.php3
> RewriteEngine on
# Add here (needed in this context):
RewriteBase /
> RewriteRule ^(.*).html$ 404.html [QSA,L]
> </Directory>
> ...
>
> but i would like to move the rewrite rules to a .htaccess file instead of the main file so that i can set different values for
> different folders.
>
>> What does it mean? 500? 403? Crash?
>> Which version of Apache do you use?
> i'm using Apache/2.0.44 (Win32)
> when i go to the folder in my browser i get Error 500
Well. First it would be interesting what the error log says ;-)
Second, it would be helpful if you'd update to 2.0.45. Especially for
windows (in fact all non-unices) some bugfixes were made in mod_rewrite,
which make the life much easier and some problems better to solve.
nd
--
die (eval q-qq:Just Another Perl Hacker
:-)
# André Malo, <http://www.perlig.de/> #
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
RE: [users@httpd] Mod rewrite question
Posted by Tim <tf...@netfactoriel.com>.
sorry! i could have been more precise.
> - What does "root"-<Directory> mean in this context?
> - You're missing a RewriteBase directive.
in my main httpd.conf i have
...
DocumentRoot "C:/Program Files/BigApache/Apache/htdocs"
...
<Directory "C:/Program Files/BigApache/Apache/htdocs">
AllowOverride AuthConfig
Options Indexes FollowSymLinks Includes
Order allow,deny
Allow from all
AddHandler type-map var
AddHandler server-parsed .html
DirectoryIndex index.asp index.html.var index.php index.php3
RewriteEngine on
RewriteRule ^(.*).html$ 404.html [QSA,L]
</Directory>
...
but i would like to move the rewrite rules to a .htaccess file instead of the main file so that i can set different values for
different folders.
> What does it mean? 500? 403? Crash?
> Which version of Apache do you use?
i'm using Apache/2.0.44 (Win32)
when i go to the folder in my browser i get Error 500
Thanks for your time
Tim
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Mod rewrite question
Posted by André Malo <nd...@perlig.de>.
* Tim wrote:
> i'm running under windows 2K, and Apache 2. in my httpd.conf, in my root <Directory> i'm using this:
> RewriteEngine on
> RewriteRule ^(.*).html$ 404.html [QSA,L]^
- What does "root"-<Directory> mean in this context?
- You're missing a RewriteBase directive.
> if i do this, the directory becomes inaccessable. what am i doing wrong?
What does it mean? 500? 403? Crash?
Which version of Apache do you use?
nd
--
Gib' mal folgendes in die Kommandozeile ein (und einen Moment warten):
net send localhost "Buuuh!"
Na, erschreckt? -- Markus Becker in mpdsh
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org