[Typo3-dev] Bug in .htaccess?

Martin Poelstra martin at beryllium.net
Fri Apr 30 16:47:39 CEST 2004


Hi all,

Well, I tested it, but things don't go too well...
I started to try the config in a <virtualhost>-directive of Apache. It gave
me the error:
RewriteBase: only valid in per-directory config files

So, that didn't work. I had to put an absolute path in front of the
index.php. Then there was the problem, that directories aren't rewritten,
because the check for .html/.pdf. With the new RealURL (not published yet),
there is the possibility to have paths without the 'index.html', so the
current rule doesn't work.

I would recommend to leave the check for html/pdf out anyway, because if a
file isn't found, we could as well pass it to index.php, so it can maybe
generate it (think of images, or other documents than pdfs) (or it may just
ignore the error). Maybe someone wants to create an extension to do
something with 'not found files' (log them in MySQL or so...), they would
have to adjust the RewriteRule then. I don't see an advantage of only
allowing .html/.pdf, except when you expect *many* requests for 'strange'
filetypes that don't exist, but I suppose that won't happen normally.

Conclusion: I'd suggest to:
- Leave out the RewriteBase alltogether and move the text about adding the
path_to_typo to the RewriteRule (including prepending slash). That works
with BOTH virtualhost (httpd.conf) AND .htaccess.
- Change the '.*\.(html|pdf)$' to just '.*': easier to read and works for
both config-ways.

And, last and certainly least: there's a little typo (yes, typo): '# Enably
URL rewriting' ;)

Server details:
Apache/1.3.29 Ben-SSL/1.53 (Debian GNU/Linux)
PHP 4.3.3

Grtz,
Martin

----- Original Message ----- 
From: "Michael Stucki" <mundaun at gmx.ch>
Newsgroups: typo3.dev
To: <typo3-dev at lists.netfielders.de>
Sent: Friday, April 30, 2004 2:42 AM
Subject: Re: [Typo3-dev] Bug in .htaccess?


> Hi Andreas & Co.
>
> since 3.6.0 will be released today I please you to check this settings
> again. I have gone through the whole thread and this is my result which I
> can include if nobody complains about it.
>
> Please remove all comment marks in order to check all settings. If TYPO3
> still works we can use that file. If not, please try to find out which
line
> turns out to cause the problems.
>
> --- cut 'final but waiting for comments' ---
> ### Begin: Rewrite stuff ###
>
> # Enably URL rewriting
> RewriteEngine On
>
> # This is important! You will have to change this path if your TYPO3
> # installation is located in a subdirectory of the website root
> RewriteBase /
>
> # Redirect http://mysite/typo3 to http://mysite/typo3/index_re.php
> # and stop the rewrite processing
> RewriteRule ^typo3$ typo3/index_re.php [L]
>
> # Stop rewrite processing if we are in the typo3/ directory
> RewriteRule ^typo3/ - [L]
>
> # If the file/symlink/directory does not exist => Redirect to index.php
> # Important note: If you copy/paste this into httpd.conf instead
> # of .htaccess you will need to add '%{DOCUMENT_ROOT}' left to each
> # '%{REQUEST_FILENAME}' part.
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteCond %{REQUEST_FILENAME} !-l
>
> # Main URL rewriting.
> # The example will rewrite all *.html and *.pdf files to index.php
> # This may be helpful when using an extension that can generate PDF files
> # on the fly.
> RewriteRule .*\.(html|pdf)$ index.php
>
> ### End: Rewrite stuff ###
>
> ### Begin: PHP optimisation ###
>
> # All features below are left to the default if you don't change this.
> # Simply remove the comment marks if you want to use some/all of these
> # settings
>
> # The PHP developers recommend disabling this feature. Do that.
> # It's deprecated and is likely to be unsupported in future versions of
PHP.
> # php_flag allow_call_time_pass_reference off
>
> # TYPO3 works fine with register_globals turned off.
> # This is highly recommended!
> # php_flag register_globals off
>
> # PHP may not declare the argv & argc variables (that would contain the
GET
> # information).
> # TYPO3 doesn't need this, so just turn it off.
> # php_flag register_argc_argv off
>
> # Magic quotes for runtime-generated data (data from SQL, exec(), etc.)
> # php_flag magic_quotes_gpc off
>
> # Order in which PHP registers GET, POST, Cookie and Built-in variables
> # php_value variables_order GPCS
>
> ### End: PHP optimisation ###
> --- cut 'final but waiting for comments' ---
>
> What about Windows installations? Does it work or not?
>
> Thanks for your help
> - michael
> -- 
> Want support? Please read the list rules first:
http://typo3.org/1438.0.html
> _______________________________________________
> Typo3-dev mailing list
> Typo3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
>






More information about the TYPO3-dev mailing list