Quantcast
Channel: PHPCode » .htaccess
Browsing all 10 articles
Browse latest View live

Set Default Language – .htaccess

You can set the default language of the browser by adding the below given code in your .htaccess file DefaultLanguage en-US

View Article



Detect iPhone – .htaccess

Paste the below given code into your .htaccess file RewriteEngine on RewriteCond %{HTTP_USER_AGENT} iPhone RewriteRule .* http://iphone.phpcodez.com/ [R]

View Article

Redirection By Language – .htaccess

Paste the below given code into your .htaccess file RewriteEngine on RewriteCond %{HTTP:Accept-Language} (en) [NC] RewriteRule .* http://en.phpcodez.com [R,L]

View Article

Block Hitbots – .htaccess

Paste the below given code into your .htaccess file RewriteEngine on RewriteCond %{HTTP_REFERER} ^http(s)?://(www.)?phpcodezz.com.*$ [NC] RewriteRule .* phpcodez.com [L]

View Article

Enable .htaccess in your server

Locate and open your httpd.conf in a text editor locate this section. locate the line that reads ‘ AllowOverride None ‘ Change it to ‘ AllowOverride All ’ Restart Apache ’

View Article


Save Bandwidth – .htaccess

Paste the following code into your .htaccess file <ifModule mod_php4.c> php_value zlib.output_compression 16386 </ifModule>

View Article

Force https htaccess

RewriteEngine On RewriteCond %{HTTPS} !on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

View Article

Force SSL htaccess

RewriteEngine On RewriteCond %{HTTPS} !on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

View Article


Redirect root domain to a subfolder .htaccess

RewriteEngine On RewriteCond %{HTTP_HOST} ^(www.)?phpcodez.com$ RewriteRule ^(/)?$ mobile [L]

View Article


Redirect root domain to a subdomain .htaccess

Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.mobile.phpcodez.com/ [R=301,L]

View Article
Browsing all 10 articles
Browse latest View live




Latest Images