IndianWebPortal.com

Something Different In Linux

Home » Archive by category 'htaccess'

php parse with shtml

Posted by Rishikesh Vispute Categories: htaccess, PHP

How to parse the php code in .shtml file. Ans : If you want to use php code in .shtml file then you need to add the following handler in .htaccess file. AddType application/x-httpd-php5  .php5 .php4 .php .php3 .php2 .phtml .shtml AddHandler application/x-httpd-php5  .php5 .php4 .php3 .php2 .phtml .shtml Done

If you want to redirect all the URLs from http to https then add the following rules in .htaccess files OR Redirect from http://domain.com/anything to https://domain.com/anything For Example : Redirect  from http://indianwebportal.com/anything to https://www.indianwebportal.com/anything ================================= RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} / RewriteRule ^(.*)$ https://www.indianwebportal.com/$1 [R,L] =================================

redirect all URLs to anoter blog URLs

Posted by Rishikesh Vispute Categories: How to, htaccess

If you want to redirect all the URLs  from one blog to another blog URLs then add the following rewrite rules in .htaccess files. Example : I have redirected  my old blog from “http://www.bestdesigns.co.in/blog to my new domain http://www.indianwebportal.com. I have added the following rewrite rules into old blog .htaccess files menas when any one  [ Read More ]

https to http redirection

Posted by Rishikesh Vispute Categories: Basic Linux, How to, htaccess

How to redirect domain from https://domain.com to http://domain.com ? Ans: If you tried all the possibilities with the .htaccess file and your domain is still not redirected from https to http then finally you can add following code in virtual host entry means in httpd.conf file. Search the 443 entry for a domain and add  [ Read More ]

How to redirect domain to sub-directory without redirect to URL

How to protect CRE Loaded admin area ? or Problem when page requires authentication or How to set  password protection for sub directory  without affecting to other .htaccess rewrite rules Ans : You will notice that the default .htaccess will not work if your page requires authentication. Suppose you have set the password protection for  [ Read More ]

How to enable SSI ?

Posted by Rishikesh Vispute Categories: How to, htaccess, PHP

How to enable Server Side Includes on the server ? Ans: First you can check SSI are enabled on your server or not.  So create one test.html file and add the following code . <!–#ECHO var=”DATE_LOCAL” –> Then access the page by using the URL http://domain.com/test.html  and  it shows the current date to the screen  [ Read More ]

cgi_bin shows the internal server error

Posted by Rishikesh Vispute Categories: Error and solution, htaccess

Error:   500 internal server error is shown when access URL http://domain.com/cgi-bin/index.php Solution : Add the following Handler in httpd.conf file or .htaccess file. AddHandler application/x-httpd-php .php Done

Remove extensions from url

Posted by Rishikesh Vispute Categories: htaccess, Knowledge

How to remove the  .php extension from the URL  ? Ans : Add the following code in .htaccess file ====================== Options +FollowSymLinks Options +Indexes RewriteEngine on RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^([^\.]+)$ $1.php [NC,L] ====================== How to remove the  .html extension from the URL  ? Ans : Add the following code in .htaccess file ====================== Options  [ Read More ]

.htaccess Generation Issues in wordpress

Posted by Rishikesh Vispute Categories: htaccess, Wordpress

Fixing .htaccess Generation Issues in wordpress If your installation of WordPress does not generate a .htaccess file or if it does not write the new rules onto your existing .htaccess file then there are a couple reasons that could be causing this. Work step by step and continue to the next step only if the  [ Read More ]

Redirect domain to .cgi file

Posted by Rishikesh Vispute Categories: Error and solution, htaccess

If you want to redirect your domain http://domain.co.uk to http://domain.co.uk/cgi-bin/test/subdirectory/test.cgi file then add the following rewrite rule in .htaccess file ==================== Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.domain\.co\.uk$ [NC] RewriteRule ^/?$ “http\:\/\/www\.domain\.co\.uk\/cgi-bin\/test\/subdirectory\/test\.cgi$1” [R=301,L] ==================== Or ==================== http://domain.com to http://domain.com/cgi-bin/subdirectory/test.cgi then add the following rewrite rule in .htaccess file ==================== RewriteEngine on RewriteCond %{HTTP_HOST} ^domain.com$ [OR]  [ Read More ]

CodeIgniter redirection problem

Posted by Rishikesh Vispute Categories: Error and solution, htaccess

If CodeIgniter is installed on the linux server and the .htaccess file is correct but your domain is not working properly then you need to set the  “uri_protocol” in the “system/application/config/config.php” file is as follows. $config[‘uri_protocol’]    = “REQUEST_URI”;

Redirect one page to another page by using .htaccess

Posted by Rishikesh Vispute Categories: htaccess

Add the following rule in .htaccess file 1) If you want to redirect one page to another page, add the following code to the file, on a single line. redirect 301 /old-file-name.htm   http://www.domain.com/new-file-name.htm

Create your own Apache Rewrite Log file

Posted by Rishikesh Vispute Categories: cpanel, htaccess

How to Create your own Apache Rewrite Log file ? If your account is hosted on suexec server then you need to add this code in http.conf file otherwise you can enable it by using .htaccess file. By using  http.conf file You need to ============================= # Roll your own Rewrite log # Log details via  [ Read More ]

Some time the root domain .htaccess file rule affect to addon domains. So you can not access your addon domain properly. If you want to disable this rule for the addon domain then you need to add the following rule in the root domain .htaccess file. RewriteCond %{HTTP_HOST} ^(www\.)?addon_domain\.com Rewriterule .* – [L] for example  [ Read More ]

Client denied by server configuration

Posted by Rishikesh Vispute Categories: Error and solution, htaccess

Client denied by server configuration : Error : tail -f /usr/local/apache/logs/error_log | grep username [Sun Dec 07 14:04:38 2008] [error] [client 203.193.165.98] client denied by server configuration: /home/username/public_html/catalog/admin/index.php Solution: If you get above error then you need to check .htaccess file under respective directory(here catalog/admin) and there you need to comment the rule “Deny from  [ Read More ]

Popular Posts

remove index.php fro

How to remove index.php from url in magento Ans : If you ...

PHP-Java bridge on p

  What is php-java bridge? The php-java bridge is the php ...

Set expiration for y

If you want to set the expiration to your site ...

Warning: Parameter 1

Error: Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a ...

domain pointing to e

If you domain uses external MX record and it is ...