Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.mobile.phpcodez.com/ [R=301,L]
Category Archives: .htaccess
Redirect root domain to a subfolder .htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?phpcodez.com$
RewriteRule ^(/)?$ mobile [L]
Force SSL htaccess
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Force https htaccess
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Save Bandwidth – .htaccess
Paste the following code into your .htaccess file
<ifModule mod_php4.c>
php_value zlib.output_compression 16386
</ifModule>
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 ’
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]
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]
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]
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