Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5980319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:47:02+00:00 2026-05-22T21:47:02+00:00

I have a rewrite rule in .htaccess RewriteRule (.+?\.fid)/ /$1 [L] with a request

  • 0

I have a rewrite rule in .htaccess

RewriteRule   (.+?\.fid)/ /$1 [L]

with a request URI like: /123.fid/myfile.webm

How can I force the mime type to: video/webm using .htaccess including the rule above?

What I have attempted already, to add on TOP of the .htaccess file without success:

AddType video/webm .webm

and

<FilesMatch  "\.webm$">
  ForceType video/webm
</FilesMatch>

I use apaches mime_magic module to look up mime type of .fid files, but this doesn’t apply to webm files. I’m assuming it’s the RewriteRule which is causing problems with the file type, and I need to look for webm in the request uri somehow.

If I do: AddType video/webm .fid the correct mime type is sent – but this breaks any other file format stored in .fid. Using .fid is a design requirement and cannot change.

*Edit:

I also attempted:

RewriteCond %{REQUEST_URI} \.webm$
RewriteRule .* - [T=video/webm]

and

RewriteRule \.webm$ - [T=video/webm]

with the same result. The mime type served is text/plain. Could this be mime_magic module interfiering?

I also attempted to add: DefaultType video/webm which works. This is the closest thing to a solution currently, as mime_magic module seems to find the correct mime types to send, but I don’t find this to be a particularly elegant solution

*Edit2: AddType video/webm .fid IS working – how can I conditionally do AddType based on request uri?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:47:03+00:00Added an answer on May 22, 2026 at 9:47 pm

    Unable to get this to work in Apache, I gave up and moved to nginx instead. I got it to work in nginx using:

    location ~\.webm$ {
      add_header Content-Type video/webm;
      rewrite  (.+?\.fid)/ /$1  break;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have the following htaccess rewrite rule: RewriteRule (.*) index.php/$1 [L] How do
I have this rule in my .htaccess RewriteRule ^([^/\.]+)/?$ ?page=user&id=$1 [L] It rewrite a
I need to rewrite a rule using htaccess, I currently have the following: RewriteRule
I have the following rewrite rule in my .htaccess file: RewriteRule ^([^/]+)/([^/]+)/(tab:([^/]+)/?)?(scope:([^/]+)/?)?(sort:([^/]+)/?)?(p:\d+)/?)?$ web/results.php?view=$1&q=$2&tab=$4&searchscope=$6&sortBy=$8&page=$10 [NC,QSA,L]
I have this rewrite rule in my .htaccess RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^([^/.]+)/?(.*)$ /$1.php/$2
I have a rewrite rule in my htaccess file like in the following example:
I have a rewrite rule that looks like this: RewriteEngine On RewriteRule ^$ store
Little question with .htaccess rewrite rule.. I want to redirect http request like that:
In my .htaccess file i have the following re-write rule RewriteRule ^([a-z]*)$ work.php?album=$1 [L]
I currently have a .htaccess file set up with this rule: RewriteRule ^([a-zA-Z0-9_-]+)$ user\.php?user=$1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.