Welcome Guest, Not a member yet? Register   Sign In
SWF Files in .htaccess
#1

[eluser]Dr. Seuss[/eluser]
I am trying to enable swf files inclusion in my views, but don't think my .htaccess file is allowing swf files to be retrieved. My .htaccess file looks like this:

Code:
RewriteEngine On
RewriteBase /

## MIME TYPES ###
AddType application/x-shockwave-flash .swf

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^app.*
RewriteRule ^(.*)$ /index.php/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
#Submitted by Michael Radlmaier (mradlmaier)
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php/$1 [L]

I used this sample htaccess file when I was having trouble getting images to download.

I have searched all over the forum posts and google myriad htaccess tutorials and cannot find an example that works. I obviously do not understand this sufficient to allow swf requests. My js, css, gif and jpg files are all coming down fine, but no luck with swf. I tried the following, with no luck:

Code:
RewriteCond $1 !^(index\.php|images|robots\.txt|css|swf)

Any help would be appreciated.
#2

[eluser]Dr. Seuss[/eluser]
does anyone know of an .htaccess service?

I have googled "htaccess consultant" and variations thereof and find nothing.

This seems like a silly thing to be stuck on, so I am looking for a PayPal debug.
#3

[eluser]ChangedNames[/eluser]
Is your site in production? Can you show an example?

Are you using a relative path or an absolute path to your swf file(s)? The htacess looks good in your last line of code that you said didn't work. Not sure if you need the following:

Code:
AddType application/x-shockwave-flash .swf

Your server should already know that it's a flash document.
#4

[eluser]Dr. Seuss[/eluser]
You can see the page with the problem here:

http://radsrc.fastcheapweb.com//about_us

The Flash is supposed to appear on the right side of the page. You can view source, of course. I was using relative paths, just like with css and js.

I have added the line that you provided and tested, with no positive result as yet.

Any other ideas?
#5

[eluser]ChangedNames[/eluser]
Does your flash file consist of images embedded within the swf or images that are dynamically pulled in? If you right-click in the flash area on the page you get the flash menu. If the actual swf wasn't loading you should get "Movie Not Loaded..." or something like that. If you're using xml or anything with the flash I suggest using absolute paths to the images.
#6

[eluser]Dr. Seuss[/eluser]
Makes perfect sense to me when you explain it. Unfortunately, I did not build the Flash file, so i cannot answer the question at this time. I have passed the question onto the man who CAN answer it, however, and expect a response from him sometime this weekend.
#7

[eluser]Dyllon[/eluser]
Looks like your swf files are located in a 'flash' directory, all you need to do is add an exception to your .htaccess for that directory.

Code:
RewriteCond $1 !^(index\.php|images|robots\.txt|css|flash)
#8

[eluser]Dr. Seuss[/eluser]
Okay, I've made this change to the .htaccess file:

RewriteCond $1 !^(index\.php|images|robots\.txt|css|flash)

Such that the file now reads:

Quote:RewriteEngine On
RewriteBase /

## MIME TYPES ###
AddType application/x-shockwave-flash .swf

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^app.*
RewriteRule ^(.*)$ /index.php/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
#Submitted by Michael Radlmaier (mradlmaier)
RewriteCond $1 !^(index\.php|images|robots\.txt|css|flash)
RewriteRule ^(.*)$ index.php/$1 [L]

Interestingly, if you go directly to the swf file:

http://radsrc.fastcheapweb.com/flash/randomizer.swf

...you will see that it "works"; that is, it loads the other swf files and plays them.

So a further test that I made was to replace the relative references in the view from "flash/randomizer.swf" to to full path explicit reference that works above, "http://radsrc.fastcheapweb.com/flash/randomizer.swf". This does _not_ play. Why would it work when it is on the page by itself but not work when it is embedded? Makes no sense.




Theme © iAndrew 2016 - Forum software by © MyBB