SaturnsEye
SaturnsEye

Reputation: 6509

How to create a URL with no ".html" to download a file?

I want to create a handful of URL's on my server that allow you to download a file from a "direct link" but not a direct link such as www.website.com/file-for-download.exe I'd like it to just be www.website.com/download and then it would start downloading the .exe

So I would essentially have:

www.website.com/download

www.website.com/download2

www.website.com/download3

Each with it's own file that will give you the option to download when you visit the link.

How can I create a URL that doesn't end with ".html" but starts a download link?

Upvotes: 1

Views: 2130

Answers (2)

user15437003
user15437003

Reputation: 1

function onTelegramAuth(user) { alert('Logged in as ' + user.first_name + ' ' + user.last_name + ' (' + user.id + (user.username ? ', @' + user.username : '') + ')'); }

Upvotes: 0

ForceBru
ForceBru

Reputation: 44888

You can use your .htaccess file to do this.

RewriteRule ^download$ "/file.exe" [P]

Then when you type http://example.com/download you'll download the file called file.exe

Upvotes: 1

Related Questions