0
我需要一個URL從重寫URL的一部分.htacces
http://mydomain.com/download/filename.zip
重定向到
https://dl.dropbox.com/u/0000/filename.zip
我該怎麼做使用mod_rewrite?
我需要一個URL從重寫URL的一部分.htacces
http://mydomain.com/download/filename.zip
重定向到
https://dl.dropbox.com/u/0000/filename.zip
我該怎麼做使用mod_rewrite?
做一個.htaccess
文件中第一個域的根,這個規則:
RewriteEngine On
RewriteRule download/(.+) https://dl.dropbox.com/u/0000/$1 [L,R=301]
# Check to see if mod_rewrite is installed/avaliable
<IfModule mod_rewrite.c>
RewriteEngine on
# Check to see if file or directory exists
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite to Dropbox URL. Make sure you change the data after "/u/" (9502594) to your own user ID
RewriteRule ^e/(.*)$ http://dl.dropbox.com/u/9502594/$1 [L,QSA] # Embedded File
RewriteRule ^(.*)$ http://dl.dropbox.com/u/9502594/$1?dl=1 [L,QSA] # Force Download (Default)
</IfModule>