htaccess

Solutions on MaxInterview for htaccess by the best coders in the world

showing results for - "htaccess"
Serena
27 Oct 2018
1RewriteEngine On
2RewriteCond %{REQUEST_FILENAME} !-f
3RewriteCond %{REQUEST_FILENAME} !-d
4RewriteRule ^(.*)$ index.php/$1 [L]
5
Leah
13 Jul 2016
1//Force HTTPS
2
3RewriteEngine on
4RewriteCond %{HTTPS} !on
5RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
6
7//Force www
8RewriteEngine on
9RewriteCond %{HTTP_HOST} ^htmlg\.com [NC]
10RewriteRule ^(.*)$ http://www.htmlg.com/$1 [L,R=301,NC]
11
12//Force non-www
13RewriteEngine on
14RewriteCond %{HTTP_HOST} ^www\.htmlg\.com [NC]
15RewriteRule ^(.*)$ http://htmlg.com/$1 [L,R=301]
16
17//Custom Error Pages
18ErrorDocument 500 "Sorry, something went wrong!"
19ErrorDocument 401 https://htmlg.com/404/
20ErrorDocument 404 404error.html
21
22//Redirect Entire Site
23Redirect 301 / https://htmlg.com/
24
25//Permanent Page Redirect
26Redirect 301 /oldlink.html https://htmlg.com/help/
27Redirect 301 /oldlink https://htmlg.com/about/
28
29//Alias Directory
30RewriteEngine On
31RewriteRule ^source_directory/(.*) target_directory/$1
32
33//Remove .php Extension
34RewriteEngine On
35RewriteCond %{SCRIPT_FILENAME} !-d
36RewriteRule ^([^.]+)$ $1.php [NC,L]
37
38//Block IP Address
39Order deny,allow
40Allow from all
41Deny from 123.123.123.123
42Deny from 123.123.123.123
43
44//Allow Access From Only One IP
45# Require all denied
46# Require ip 123.123.123.123
47
Jorge
03 Jul 2018
1# 7G FIREWALL v1.2 20190727
2# @ https://perishablepress.com/7g-firewall/
3# 7G:[QUERY STRING]
4<IfModule mod_rewrite.c>
5	
6	RewriteCond %{REQUEST_URI} !(7g_log.php) [NC]
7	
8	RewriteCond %{QUERY_STRING} ([a-z0-9]{2000,}) [NC,OR]
9	RewriteCond %{QUERY_STRING} (/|%2f)(:|%3a)(/|%2f) [NC,OR]
10	RewriteCond %{QUERY_STRING} (/|%2f)(\*|%2a)(\*|%2a)(/|%2f) [NC,OR]
11	RewriteCond %{QUERY_STRING} (~|`|<|>|\^|\|\\|0x00|%00|%0d%0a) [NC,OR]
12	RewriteCond %{QUERY_STRING} (cmd|command)(=|%3d)(chdir|mkdir)(.*)(x20) [NC,OR]
13	RewriteCond %{QUERY_STRING} (fck|ckfinder|fullclick|ckfinder|fckeditor) [NC,OR]
14	RewriteCond %{QUERY_STRING} (/|%2f)((wp-)?config)((\.|%2e)inc)?((\.|%2e)php) [NC,OR]
15	RewriteCond %{QUERY_STRING} (thumbs?(_editor|open)?|tim(thumbs?)?)((\.|%2e)php) [NC,OR]
16	RewriteCond %{QUERY_STRING} (absolute_|base|root_)(dir|path)(=|%3d)(ftp|https?) [NC,OR]
17	RewriteCond %{QUERY_STRING} (localhost|loopback|127(\.|%2e)0(\.|%2e)0(\.|%2e)1) [NC,OR]
18	RewriteCond %{QUERY_STRING} (\.|20)(get|the)(_|%5f)(permalink|posts_page_url)(\(|%28) [NC,OR]
19	RewriteCond %{QUERY_STRING} (s)?(ftp|http|inurl|php)(s)?(:(/|%2f|%u2215)(/|%2f|%u2215)) [NC,OR]
20	RewriteCond %{QUERY_STRING} (globals|mosconfig([a-z_]{1,22})|request)(=|\[|%[a-z0-9]{0,2}) [NC,OR]
21	RewriteCond %{QUERY_STRING} ((boot|win)((\.|%2e)ini)|etc(/|%2f)passwd|self(/|%2f)environ) [NC,OR]
22	RewriteCond %{QUERY_STRING} (((/|%2f){3,3})|((\.|%2e){3,3})|((\.|%2e){2,2})(/|%2f|%u2215)) [NC,OR]
23	RewriteCond %{QUERY_STRING} (benchmark|char|exec|fopen|function|html)(.*)(\(|%28)(.*)(\)|%29) [NC,OR]
24	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]
25	RewriteCond %{QUERY_STRING} (e|%65|%45)(v|%76|%56)(a|%61|%31)(l|%6c|%4c)(.*)(\(|%28)(.*)(\)|%29) [NC,OR]
26	RewriteCond %{QUERY_STRING} (/|%2f)(=|%3d|$&|_mm|cgi(\.|-)|inurl(:|%3a)(/|%2f)|(mod|path)(=|%3d)(\.|%2e)) [NC,OR]
27	RewriteCond %{QUERY_STRING} (<|%3c)(.*)(e|%65|%45)(m|%6d|%4d)(b|%62|%42)(e|%65|%45)(d|%64|%44)(.*)(>|%3e) [NC,OR]
28	RewriteCond %{QUERY_STRING} (<|%3c)(.*)(i|%69|%49)(f|%66|%46)(r|%72|%52)(a|%61|%41)(m|%6d|%4d)(e|%65|%45)(.*)(>|%3e) [NC,OR]
29	RewriteCond %{QUERY_STRING} (<|%3c)(.*)(o|%4f|%6f)(b|%62|%42)(j|%4a|%6a)(e|%65|%45)(c|%63|%43)(t|%74|%54)(.*)(>|%3e) [NC,OR]
30	RewriteCond %{QUERY_STRING} (<|%3c)(.*)(s|%73|%53)(c|%63|%43)(r|%72|%52)(i|%69|%49)(p|%70|%50)(t|%74|%54)(.*)(>|%3e) [NC,OR]
31	RewriteCond %{QUERY_STRING} (\+|%2b|%20)(d|%64|%44)(e|%65|%45)(l|%6c|%4c)(e|%65|%45)(t|%74|%54)(e|%65|%45)(\+|%2b|%20) [NC,OR]
32	RewriteCond %{QUERY_STRING} (\+|%2b|%20)(i|%69|%49)(n|%6e|%4e)(s|%73|%53)(e|%65|%45)(r|%72|%52)(t|%74|%54)(\+|%2b|%20) [NC,OR]
33	RewriteCond %{QUERY_STRING} (\+|%2b|%20)(s|%73|%53)(e|%65|%45)(l|%6c|%4c)(e|%65|%45)(c|%63|%43)(t|%74|%54)(\+|%2b|%20) [NC,OR]
34	RewriteCond %{QUERY_STRING} (\+|%2b|%20)(u|%75|%55)(p|%70|%50)(d|%64|%44)(a|%61|%41)(t|%74|%54)(e|%65|%45)(\+|%2b|%20) [NC,OR]
35	RewriteCond %{QUERY_STRING} (\\x00|(\"|%22|\'|%27)?0(\"|%22|\'|%27)?(=|%3d)(\"|%22|\'|%27)?0|cast(\(|%28)0x|or%201(=|%3d)1) [NC,OR]
36	RewriteCond %{QUERY_STRING} (g|%67|%47)(l|%6c|%4c)(o|%6f|%4f)(b|%62|%42)(a|%61|%41)(l|%6c|%4c)(s|%73|%53)(=|[|%[0-9A-Z]{0,2}) [NC,OR]
37	RewriteCond %{QUERY_STRING} (_|%5f)(r|%72|%52)(e|%65|%45)(q|%71|%51)(u|%75|%55)(e|%65|%45)(s|%73|%53)(t|%74|%54)(=|[|%[0-9A-Z]{0,2}) [NC,OR]
38	RewriteCond %{QUERY_STRING} (j|%6a|%4a)(a|%61|%41)(v|%76|%56)(a|%61|%31)(s|%73|%53)(c|%63|%43)(r|%72|%52)(i|%69|%49)(p|%70|%50)(t|%74|%54)(:|%3a)(.*)(;|%3b|\)|%29) [NC,OR]
39	RewriteCond %{QUERY_STRING} (b|%62|%42)(a|%61|%41)(s|%73|%53)(e|%65|%45)(6|%36)(4|%34)(_|%5f)(e|%65|%45|d|%64|%44)(e|%65|%45|n|%6e|%4e)(c|%63|%43)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(.*)(\()(.*)(\)) [NC,OR]
40	RewriteCond %{QUERY_STRING} (allow_url_(fopen|include)|auto_prepend_file|blexbot|browsersploit|(c99|php)shell|curltest|disable_functions?|document_root|elastix|encodeuricom|exec|exploit|fclose|fgets|fputs|fsbuff|fsockopen|gethostbyname|grablogin|hmei7|input_file|load_file|null|open_basedir|outfile|passthru|popen|proc_open|quickbrute|remoteview|root_path|safe_mode|shell_exec|site((.){0,2})copier|sux0r|trojan|wget|xertive) [NC,OR]
41	RewriteCond %{QUERY_STRING} (;|<|>|\'|\"|\)|%0a|%0d|%22|%27|%3c|%3e|%00)(.*)(/\*|alter|base64|benchmark|cast|char|concat|convert|create|encode|declare|delete|drop|insert|md5|order|request|script|select|set|union|update) [NC,OR]
42	RewriteCond %{QUERY_STRING} ((\+|%2b)(concat|delete|get|select|union)(\+|%2b)) [NC,OR]
43	RewriteCond %{QUERY_STRING} (union)(.*)(select)(.*)(\(|%28) [NC,OR]
44	RewriteCond %{QUERY_STRING} (concat)(.*)(\(|%28) [NC]
45	
46	RewriteRule .* - [F,L]
47	
48	# RewriteRule .* /7g_log.php?log [L,NE,E=7G_QUERY_STRING:%1___%2___%3]
49	
50</IfModule>
Neele
06 Jan 2017
1# Browser Caching
2ExpiresActive On
3ExpiresByType image/jpg "access 1 month"
4ExpiresByType image/jpeg "access 1 month"
5ExpiresByType image/gif "access 1 month"
6ExpiresByType image/png "access 1 month"
7ExpiresByType image/x-icon "access 1 month"
8ExpiresByType text/css "access 1 month"
9ExpiresByType application/pdf "access 1 month"
10ExpiresByType text/x-javascript "access 1 month"
11ExpiresByType application/x-shockwave-flash "access 1 month"
12ExpiresDefault "access 3 days"
13
Ana
06 Feb 2016
1
2# BEGIN WordPress
3
4RewriteEngine On
5RewriteBase /
6RewriteRule ^index\.php$ - [L]
7RewriteCond %{REQUEST_FILENAME} !-f
8RewriteCond %{REQUEST_FILENAME} !-d
9RewriteRule . /index.php [L]
10
11# END WordPress
12
Simona
30 Jul 2016
1php_value upload_max_filesize 128M
2php_value post_max_size 128M
3php_value memory_limit 256M
4php_value max_execution_time 300
5php_value max_input_time 300
6
queries leading to this page
what does htaccess meancodeigniter htaccess htaccess htaccess file usecodeigniter htaccess examplehtaccess syntax explainedhtaccess phpwhat does 21 5c mean in htaccesswhat does htaccess containuse of htaccess file in codeigniterhtaccess in codeigniter server in folder htaccess syntaxhtacccess for codeigniter htaccess filehow to use htaccess filecodeigniter 4 basic htaccess filewhere to put htaccesscodeigniter htaccess filehow htaccess file working in codeigniterhtml htaccess htaccess codeigniter serverwas muss in einer htaccess datei stehenwhere to use htaccesshtaccess codeigniter 3 htaccess file code htaccess for codeigniterwhat is an htaccess fileweb htaccesscodeigniter htaccess fileaccess htaccesshtaccess file location in codeigniter htaccess httpset htaccess htaccess htmlcodeignitor urlhow to remove index php in codeigniter 4which htaccess file is usedcodeigniter 3 htaccess filehtaccess file code in codeigniterhtaccess action php codeigniter htaccess codehtaccess file for codeigniter 4htaccess in codeigniter htaccess file tutorial htaccess file in php codeigniterwhat is the htaccess filewhere to put htaccess beexample htaccessstandard htaccess filecodeigniter default htaccess filewhere is htaccess file htaccess file codeigniterhtaccess syntaxcodeigniter 3 htaccess htaccess for html sitewhat is the use of htaccess file htaccess file in codeigniterdefault codeigniter htaccesswhat is htaccess filewhere is htaccess htaccess codeigniter 4 htaccess docwrite a file in codeigniter 28 2a 29 in htaccessaccess file htaccess htaccess file htaccess option example htaccesshtaccess for codeigniter 4htaccess example htaccess code for codeigniterhtaccess codeigniter 4 htaccesswhat is htaccess in php htaccess file for codeignitercodeigniter htaccess file codedownload htaccess file for codeigniter 3what does a htaccess file do in codeignitercodiegniter htaccess file htaccess file examplewhat is htaccess filewhat is a htaccess file htaccess file content in codeigniter htaccess file not workingusing htaccesswhat does a htaccess file do 3fcodeigniter rewrite urlcodeingiter apache htaccesswhy 2 htaccess file have in codeigniterci remove index phpci default app url codeigniter apache htaccess generatorcodeigniter 3 remove index phpwhat is htaccess in codeigniter htaccess codehow to set up htaccess in codeigniter htaccess documentationcodeigniter rewritecodeigniter htaccsswhat htaccess filepurpose of htaccess filehtaccess file to add in codeigniterhtaccess htmlvalet codeigniter htaccessexample of htaccess filehttp 3a 2f 2f 5b 3a 3a1 5d remove from code igniterhow to php htaccess htaccess in jshtaccess codeigniter fileunderstanding htaccess filecodeigniter how to use without htaccesshtml htaccesscodeigniter htaccesshow to opne htaccess filecodeigniter htaccess file in applicationsremove index php in codeigniter projecthtaccess codeigniter 4how to set htaccess htaccess for codeigniter 3htaccess file codeigniterurl rewrite codeigniteroptions htaccessdefault htaccessfull htaccess for codeigniterhtml html htaccesshtaccess file for codeigniter htaccess locationhtaccess code htaccesshtaccess using htaccess in codeigniterhtaccess file for codeigniter 3htaccess optionswhere to put htaccess file in codeigniterhtaccess uses htaccess codeigniterremove index php in codeigniter 3what is a htaccess filecodeigniter htaccess use wwwcodeiginiter htaccess filehtaccess codeigniterdownload htaccess in codeigniterhtaccess for codeigniter htaccess file htaccess example 28 2a 29 htaccesscodeigniter 4 htaccesshtaccess fileexample htaccess filewhat is the htaccess filecodeigniter htaccess file downloadfile htaccesshtaccess 28 3f 3awww 29 3f 28 2b htaccess httpdefault htaccessfile htaccess htaccess linuxhtaccess file codeigniter3where is htaccesscodeigniter2 index phpwhere to put htaccessremove index php codeigniter 3htaccess