phpmycoder
04-12-2009, 11:09 PM
Hello,
I am mainly a PHP programmer that is working on my personal website, www.phpmycoder.net (which I just bought for hostmonster!!). I'm working on the subdomain that will hold all my javascript, css, and images. This subdomain will be assets.phpmycoder.net. I am currently working on an htaccess file that will redirect all traffic that is not a request for an image, script, or stylesheet to my home page at www.phpmycoder.net. When I try to view an image on my assets subdomain I get a 500 server error that says that my htaccess is incorrectly coded...here is the source:
RewriteEngine On
RewriteCond %{REQUEST_URI} != ^(.*)/images/(.*)\.jpg$ [OR]
RewriteCond %{REQUEST_URI} != ^(.*)/images/(.*)\.gif$ [OR]
RewriteCond %{REQUEST_URI} != ^(.*)/css/(.*)\.css$ [OR]
RewriteCond %{REQUEST_URI} != ^(.*)/js/(.*)\.js$
RewriteRule ^(.*)$ http://www.phpmycoder.net/ [r=301]
It's also important to note that within the assets subdomain there are folders for the images css and javascript (called images, css, and js receptively). Could someone aid me in fixing my htaccess file??
Thanks!!!
PhpMyCoder
I am mainly a PHP programmer that is working on my personal website, www.phpmycoder.net (which I just bought for hostmonster!!). I'm working on the subdomain that will hold all my javascript, css, and images. This subdomain will be assets.phpmycoder.net. I am currently working on an htaccess file that will redirect all traffic that is not a request for an image, script, or stylesheet to my home page at www.phpmycoder.net. When I try to view an image on my assets subdomain I get a 500 server error that says that my htaccess is incorrectly coded...here is the source:
RewriteEngine On
RewriteCond %{REQUEST_URI} != ^(.*)/images/(.*)\.jpg$ [OR]
RewriteCond %{REQUEST_URI} != ^(.*)/images/(.*)\.gif$ [OR]
RewriteCond %{REQUEST_URI} != ^(.*)/css/(.*)\.css$ [OR]
RewriteCond %{REQUEST_URI} != ^(.*)/js/(.*)\.js$
RewriteRule ^(.*)$ http://www.phpmycoder.net/ [r=301]
It's also important to note that within the assets subdomain there are folders for the images css and javascript (called images, css, and js receptively). Could someone aid me in fixing my htaccess file??
Thanks!!!
PhpMyCoder