Pages

Showing posts with label .htaccess. Show all posts
Showing posts with label .htaccess. Show all posts

Wednesday, November 12, 2014

PHP-Localize php.ini configs for any directory

Recently while installing Joomla 3.0 I came across a blocker My Hosting Provider's php.ini said

magic_quotes_gpc = on;

which was hindering my way in installation of Joomla on Hosting Space I had...

I was looking for a work around and here is what I did simply...

1. Created a file called php.ini(or php5.ini-to taste of your php installation) in my local directory and added 

magic_quotes_gpc = off;

2. Secondly I created .htaccess and added following lines of code to the same

 
 <IfModule mod_suphp.c>  
  suPHP_ConfigPath /home/blart/public_html/interiors  
  <Files php.ini>  
   order allow,deny  
   deny from all  
  </Files>  
 </IfModule>  

The following directory contains my php.ini file
/home/blart/public_html/interiors  


That's it and I had my  php.ini localized

Tuesday, November 6, 2012

.htacess rewrite rule translation example

RewriteRule  ^builder/([0-9]*)/([0-9]*)/([a-z]*)/([a-z]*)$   wp_content/plugins/career/mkr.php?page_id=$1&r_id=$2&user=$3&rtype=$4 [L]


This rule means that is we encounter a url which starts with builder followed by an integer again followed by an integer then an alphabet then an alphabet and then end convert it to the url after space for example

A Url

domain.com/builder/3/6/alpha/beta will be converted to

domain.com/wp_content/plugins/career/mkr.php?page_id=3&r_id=6&user=alpha&rtype=beta

That's how translation occurs

Sunday, July 8, 2012

Check the status of ur local .htaccess and mod_rewrite

Check if mod_rewrite is enabled and your htaccess file is overriding

1) create a page phpinfo.php in your root call the phpinfo() function in the same

2) Now request this page from ur browser and look for a section called Loaded Modules.If it shows mod_rewrite....bingo its enabled from server

3) Next backup ur .htaccess default file and create a new one in that write

DirectoryIndex phpinfo.php

Now request ur website root from browser if you see phpinfo.php being called ur .htaccess is working in other words #allow override is enabled at httpconfig.