![]() |
.htaccess crap
I have this .htaccess file:
AddType application/x-httpd-php .php .html RewriteEngine On RewriteCond %{HTTP_REFERER} !^http://(www\.)?pornpartyporn\.com [NC] RewriteCond %{HTTP_REFERER} !^$ RewriteCond %{HTTP_REFERER} ^http://.*$ RewriteRule \.(jpe?g|gif|bmp|png|jpg|mpg|mpeg|wmv)$ http://www.pornlinkworld.com/freesites/hotlink.gif [L] this line doesn't work: AddType application/x-httpd-php .php .html am I missing something? |
Just a guess, but you're probably causing an error when you're trying to override .html. That extension is probably already defined in the httpd.conf. Now the .php, on the other hand, might be up for grabs (depending on if it's defined in the httpd.conf or not). That's my immediate guess without really seeing or testing anything.
|
doesn't work meaning what?
pages aren't parsed for php? web pages all of the sudden pop up save-as boxes? Error 500 - Internal Server Error pops up? |
it still doesn't work if I remove the .html or if I remove the line entirely
|
Quote:
pages aren't parsed for php, it just shows the code |
RamCharger:
Xallow is trying to add the html extension as a parsable(?) php script, hence the AddType declaration. Xallow: What webhost are you using? You shouldn't need to tell it to declare .php extensions as a PHP script, as that should be done in the httpd.conf when PHP is installed. I have the following line in my .htaccess: AddType application/x-httpd-php .html It succesfully parses all .html folders in the folder (and subfolders) as php. Try your .htaccess with the same line as mine (i.e. without the '.php') Another thing to make sure of (I only mention it because I have made the error twice) is that you are uploading the .htaccess as an ASCII file type. If all the above fails, I'd guess a configuration error at the host. |
Another thing to make sure of (I only mention it because I have made the error twice) is that you are uploading the .htaccess as an ASCII file type.
How do You make it so it isn't a ASCII file type? |
Quote:
|
Ok, I tried it on another server with another host aswell and there it works like a charm, so I have sent the support guys a mail about the issue
|
well, the host doesn't support that function so i guess that wont be happening :(
|
Quote:
|
RewriteEngine on
RewriteRule ^whatever.html$ whatever.php [QSA] not that it a perfect solution, but, it is a workaround |
Quote:
Also, I need to do this for a lot of pages, so I put them all in there like that? |
You might be able to use something like
RewriteRule ^(.*)\.html$ $1.php [QSA] but then you would want to also make sure the destination file exists, etc. I'm not sure why your hosting company won't turn it on for you -- the load generated is exactly the same. If you can't parse .html pages with php, and you rename all your pages to php so that they can be parsed, there is no difference in terms of cpu horsepower required to serve your site. The right solution is to just have them turn on php parsing for html pages. I'm not sure what your hosting company's resistance is to doing that. |
All times are GMT -4. The time now is 06:58 AM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc