Web Hosting! - mod_rewrite

Hello, I would like someone who knows this to answer. My web project running on my local server does not work on infintyfree hosting. What is the reason for this? Isn’t mod_rewrite enabled?

Website Link: https://turkleaks.rf.gd/

mod_rewrite is enabled. Can you show us the contents of your htaccess file?

php_flag display_errors 0
RewriteEngine on  
RewriteBase /
ErrorDocument 400 /error.php
ErrorDocument 401 /error.php
ErrorDocument 403 /error.php
ErrorDocument 404 /error.php
ErrorDocument 500 /error.php
ErrorDocument 503 /error.php
RewriteCond %{THE_REQUEST} (.*)\.php  
RewriteRule ^(.*)\.php $1.jsp [R=301,L]  
RewriteCond %{THE_REQUEST} (.*)\.jsp  
RewriteRule ^(.*)\.jsp $1.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
<files .htaccess>
order allow,deny
deny from all
ServerSignature Off
Options -Indexes
Options FollowSymLinks
Header always unset X-Powered-By
Header unset X-Powered-By
RequestHeader unset Range env=bad-range
SetEnvIf Range (,.*?){5,} bad-range=1
Header add Content-Language: "tr-TR"
Header add Cache-Control: "private"
Header set Feature-Policy "geolocation 'self'; vibrate 'none'"
Header set X-Frame-Options DENY
Header set X-Content-Type-Options "nosniff"
Header set X-Content-Security-Policy "allow 'self';"
Header set X-XSS-Protection "1; mode=block"
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ - [F,L]
RewriteCond %{REQUEST_URI} (timthumb\.php|phpthumb\.php|thumb\.php|thumbs\.php) [NC]
RewriteRule . - [S=1]
#RewriteCond %{HTTP_REFERER} ^https://(protect|unprotected)\.mydomain\.com
#RewriteRule ^ - [L]
#RewriteRule ^ https://unprotected.mydomain.com/ [R,L]
RewriteCond %{HTTP_USER_AGENT} (libwww-perl|wget|python|nikto|curl|scan|java|winhttp|clshttp|loader) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (;|<|>|'|"|\)|\(|%0A|%0D|%22|%27|%28|%3C|%3E|%00).*(libwww-perl|wget|python|nikto|curl|scan|java|winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner) [NC,OR]
RewriteCond %{THE_REQUEST} \/\*\ HTTP/ [NC,OR]
RewriteCond %{THE_REQUEST} etc/passwd [NC,OR]
RewriteCond %{THE_REQUEST} cgi-bin [NC,OR]
RewriteCond %{THE_REQUEST} (%0A|%0D) [NC,OR]
# Block MySQL injections, RFI, base64, etc.
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http:// [OR]
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=http%3A%2F%2F [OR]
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=(\.\.//?)+ [OR]
RewriteCond %{QUERY_STRING} [a-zA-Z0-9_]=/([a-z0-9_.]//?)+ [NC,OR]
RewriteCond %{QUERY_STRING} \=PHP[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} [NC,OR]
RewriteCond %{QUERY_STRING} (\.\./|\.\.) [OR]
RewriteCond %{QUERY_STRING} ftp\: [NC,OR]
RewriteCond %{QUERY_STRING} http\: [NC,OR]
RewriteCond %{QUERY_STRING} https\: [NC,OR]
RewriteCond %{QUERY_STRING} \=\|w\| [NC,OR]
RewriteCond %{QUERY_STRING} ^(.*)/self/(.*)$ [NC,OR]
RewriteCond %{QUERY_STRING} ^(.*)cPath=http://(.*)$ [NC,OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} (\<|%3C).*iframe.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^i]*i)+frame.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [NC,OR]
RewriteCond %{QUERY_STRING} base64_(en|de)code[^(]*\([^)]*\) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} ^.*(\[|\]|\(|\)|<|>).* [NC,OR]
RewriteCond %{QUERY_STRING} (\./|\../|\.../)+(motd|etc|bin) [NC,OR]
RewriteCond %{QUERY_STRING} (localhost|loopback|127\.0\.0\.1) [NC,OR]
RewriteCond %{QUERY_STRING} (<|>|'|%0A|%0D|%27|%3C|%3E|%00) [NC,OR]
RewriteCond %{QUERY_STRING} concat[^\(]*\( [NC,OR]
RewriteCond %{QUERY_STRING} union([^s]*s)+elect [NC,OR]
RewriteCond %{QUERY_STRING} union([^a]*a)+ll([^s]*s)+elect [NC,OR]
RewriteCond %{QUERY_STRING} (;|<|>|'|"|\)|%0A|%0D|%22|%27|%3C|%3E|%00).*(/\*|union|select|insert|drop|delete|update|cast|create|char|convert|alter|declare|order|script|set|md5|benchmark|encode) [NC,OR]
RewriteCond %{QUERY_STRING} ^(%2d|\-)[^=]+$ [NC,OR]
RewriteCond %{QUERY_STRING} proc\/self\/environ [NC,OR]
RewriteCond %{QUERY_STRING} (sp_executesql) [NC]
RewriteRule ^(.*)$ - [F,L]


I’m getting redirected to a .jsp page when I visit your site. IF does not support Java, so that’s probably why it’s not working.


I see

RewriteEngine on


Please debug your .htaccess rules


So why doesn’t it support it? Because it’s free?

It does. However only the jsp part will be executed


It’s not so much that “it” doesn’t support “it”, whatever “it” may be. It’s that you’re not supposed to have the RewriteEngine On directive twice in the same .htaccess file because that’s not how .htaccess files work.

Things can get confusing fast if you just paste in different .htaccess snippets from different sources without fully understanding how they work, and accidentally may end up causing conflicts between the different snippets, with unexpected consequences as a result.

The mod_rewrite module is enabled on our hosting and all mod_rewrite directives should just work. And so far you’ve old said “it works on my machine”, but that’s not exactly strong evidence that the issue must be related to .htaccess rules.

Can you please be a lot more specific? Can you please clearly state which URL/page is not working, what you expected to see, and what you actually see here?

When I check your website’s main page, I get redirected to /giris.jsp. Despite the URL, you have .htaccess rules to reroute it to /giris.php, so that code is executed. But that page itself does not return any content, and the Network tab in my browser tells me that it has a response code 500.

So I think your .htaccess code is not the problem here. Instead, your PHP code is crashing.

There are all sorts of reasons why PHP code could crash here but work on your local machine, ranging from upload issues, configuration issues or compatibility issues. In most case, those can be solved, but you will have to do some troubleshooting yourself first to see why your code is crashing.


What I don’t understand is why a website running on a virtual server like Xampp does not work on InfintyFree. This is so weird. I opened another site and it’s the same again, just a blank page appears, nothing else, I guess I won’t find this problem.

sample website: http://alperen.rf.gd/

Perhaps different Apache versions? I don’t have many problems with XAMPP and InfinityFree. Some things don’t work on XAMPP because I haven’t enabled some directives but it doesn’t cause any problems with InfinityFree.

Because creating a new domain probably won’t fix much.

Yes, it is.

You’re going to have to debug your code yourself. I don’t think anyone would be willing to go through all of the htaccess file and pinpoint every error. Please read the article that Admin posted:


I finally found the error, thank you for your articles, my last request from you is to remove this topic, is this possible? Even if removal is not possible, please delete the links to my websites from my articles.

@YT_Xaos @Admin @Greenreader9

1 Like

Glad you found the error! Unfortunately, we can’t remove your post, because it may be useful to someone in the future–even if that chance is slim. As per your website link, wait for a moderator to come online and remove them.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.