ApacheRewrite: Unterschied zwischen den Versionen

Aus crazylinux.de
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
(redirect)
Zeile 1: Zeile 1:
=internal redirect=
Another solution for getting the browser to use the right filename for saving is to use mod_rewrite to hide the fact that you are using a script at all. Either in the httpd.conf or a .htaccess file, include something like the following:
Another solution for getting the browser to use the right filename for saving is to use mod_rewrite to hide the fact that you are using a script at all. Either in the httpd.conf or a .htaccess file, include something like the following:


Zeile 5: Zeile 6:


mod_rewrite will translate the url, and the browser (and the user) won't know the difference.
mod_rewrite will translate the url, and the browser (and the user) won't know the difference.
=external redirect=
old: http://crazylinux.de/wiki/TAR<br>
new: http://crazylinux.de/TAR
RewriteRule ^/wiki/(.*)$        http://crazylinux.de/$1 [R=301,L]
the browser will see the difference
Keywords: apache,mod_rewrite,file,rewrite,url,save,saving,htaccess
Keywords: apache,mod_rewrite,file,rewrite,url,save,saving,htaccess

Version vom 16. November 2006, 23:59 Uhr

internal redirect

Another solution for getting the browser to use the right filename for saving is to use mod_rewrite to hide the fact that you are using a script at all. Either in the httpd.conf or a .htaccess file, include something like the following:

RewriteEngine On
RewriteRule ^/downloads/(.*) /getFile.php?filename=$1 [NE]

mod_rewrite will translate the url, and the browser (and the user) won't know the difference.


external redirect

old: http://crazylinux.de/wiki/TAR
new: http://crazylinux.de/TAR

RewriteRule ^/wiki/(.*)$        http://crazylinux.de/$1 [R=301,L]

the browser will see the difference


Keywords: apache,mod_rewrite,file,rewrite,url,save,saving,htaccess