# Apache rewrite with htaccess and swfobject?

**URL:** <https://forum.kirupa.com/t/apache-rewrite-with-htaccess-and-swfobject/237314>\
**Category:** Uncategorized\
**Created:** [August 29, 2007, 9:10am UTC](https://forum.kirupa.com/t/apache-rewrite-with-htaccess-and-swfobject/237314 "2007-08-29T09:10:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daheroes](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@daheroes](https://forum.kirupa.com/u/daheroes)\
**Post date:** [August 29, 2007, 9:10am UTC](https://forum.kirupa.com/t/apache-rewrite-with-htaccess-and-swfobject/237314/1 "2007-08-29T09:10:50Z")

</div>

Hi all,

I’m trying to use .htaccess to rewrite urls, much like in the tutorial on this site ([here](http://www.kirupa.com/developer/php/clean_url_pg1.htm))

I’m using the rewrite to change the start page of an xml file, which is loaded by flash.

On the page itself, I’m using SWFObject (from deconcept, [here](http://blog.deconcept.com/swfobject/)). However, whenever I try to access the page with multiple vars (like [mysite.com/firstvar/secondvar](http://mysite.com/firstvar/secondvar) ), the page doesn’t display the way it should.

Normally, the swfObject will replace the content of one div with a flash object. However, with this rewrite stuff, it doesn’t attempt to replace the content, and instead just displays it as text.

It works fine with just one variable, like this: [http://www.mysite.com/firstvar](http://www.mysite.com/firstvar)  
But it doesn’t work if I add a slash at the end: [http://www.mysite.com/firstvar/](http://www.mysite.com/firstvar/)

Right now this is my .htaccess file.

(I’m thinking the problem is in here, though I don’t know.)

```auto

# this is the initialization
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
# these are the rewrite conditions
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# and finally, the rewrite rules
RewriteRule ^([a-zA-Z0-9\-]+)/?$ /index2.php?artist=$1 [L,QSA]
#RewriteRule ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/?$ /index2.php?artist=$1&project=$2 [L,QSA]

ErrorDocument 404 http://www.mysite.com/errordocs/404.html
ErrorDocument 403 http://www.mysite.com/errordocs/403.html

Options -Indexes

RewriteCond %{REQUEST_FILENAME} .*jpg$|.*swf$|.*png$ [NC]
RewriteCond %{HTTP_REFERER} !^$ 
RewriteCond %{HTTP_REFERER} !mysite\.com [NC] 
RewriteCond %{HTTP_REFERER} !google\. [NC] 
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteRule .*\.(jpe?g|png)$ /errordocs/ring.jpe [L]

```

I’m afraid I don’t understand .htaccess well enough to see if there’s an issue there.

Can anyone help me out?
