Category Archives: Hosting

How to enable mod_rewrite in Apache?

To enable it the rewrite module, run “apache2 enable module rewrite”:

You need to restart the webserver to apply the changes:

If you plan on using mod_rewrite in .htaccess files, you also need to enable the use of .htaccess files by changing AllowOverride None to AllowOverride FileInfo. For the default website, edit/etc/apache2/sites-available/default:

 

After such a change, you need to restart Apache again.

Ref: http://askubuntu.com/questions/48362/how-to-enable-mod-rewrite-in-apache

Ubuntu – deb command-not-found

While installing New Relic‘s server monitoring on my Ubuntu server. After entering following command given at New Relics installtion instrcutions

I was getting this this error “deb command no found”, after searching for solution on internet I found following answer

Deb is not a command. You need to edit your /etc/apt/sources.list file and add the line

to the end of the file.

Redirect website to https from cpanel or htaccess file or php

If you want to redirect using htaccess, add following lines in the htacess files

We can also redirect  using php code in out header file

To redirect from cPanel,

Log into your websites control panel, then go to “Domains” section. Click on “Redirects” option

– Select type “Permanent (301)” from dropdown menu

– Select domain name which you want to redirect

– And finally enter the url to which you want the above select domain redirect to