Redirecting client to single domain name.


TechEarth

Here is a problem where a site is hosted under different virtual hosts with different domain names.

Example:
VirtualHost1 is setup for http://www.example.net
VirtualHost2 is setup for http://www.example.com

And, we want to redirect to or show only http://www.example.com domain to our clients.

Then, make some changes as below in main apache config file that is httpd.conf:

 <VirtualHost *:80>
  ServerName www.example.net
  ServerAlias example.com
  Redirect permanent / http://www.example.com/
 </VirtualHost>
<VirtualHost *:80>
 ServerName www.example.com
 DocumentRoot /usr/local/apache/htdocs
</VirtualHost>

View original post

Advertisements

Dompdf Problem in CentOS


dompdf is an useful plugin to create html to pdf file. It works fine in windows environment but it creates some problem for some version of CentOS operating system. For example, it doesn’t show any error in the browser. To fix this problem, try the following:

  1. open terminal window/shell command window.
  2. run the command:- yum install php-xml
  3. run another command:- yum install php-mbstring

The above two commands setup two important packages which is mandatory for using dompdf plugins. There is a possibility that these two packages were already installed in your OS. No matter than. If everything goes okay, then I think your dompdf plugin will now work fine.

Redirect Link to Mobile Website using .htaccess


Just add the following code in your .htaccess file


RewriteEngine on
RewriteBase /

# prevent looping
RewriteCond %{HTTP_HOST} !^m.mysite.com$

# if the browser accepts these mime-types, it's definitely mobile, or pretending to be
RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC,OR]

# a bunch of user agent tests
RewriteCond %{HTTP_USER_AGENT} "sony|symbian|nokia|samsung|mobile|windows ce|epoc|opera" [NC,OR]
RewriteCond %{HTTP_USER_AGENT} "mini|nitro|j2me|midp-|cldc-|netfront|mot|up\.browser|up\.link|audiovox"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "blackberry|ericsson,|panasonic|philips|sanyo|sharp|sie-"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "portalmmm|blazer|avantgo|danger|palm|series60|palmsource|pocketpc"[NC,OR]
RewriteCond %{HTTP_USER_AGENT} "smartphone|rover|ipaq|au-mic,|alcatel|ericy|vodafone\/|wap1\.|wap2\.|iPhone|android"[NC]

# rewrite rules here
RewriteRule .? http://m.mysite.com%{REQUEST_URI}  [L,R=302]

.htaccess and its features


HTACCESS means HyperText Access.

.htaccess files should be used in a case where the content providers need to make configuration changes to the server on a per-directory basis, but do not have root access on the server system.

Some main features of .htaccess file are:

  • ability to password protect folders
  • ban / allow users using IP addresses
  • stop directory listings
  • enable complete error reporting
  • redirect users to another page or directory automatically
  • create and use custom error pages
  • Adding MIME types
  • Setting server timezone
  • Enable SSI (Server Side Includes) with .htaccess
  • Ensuring media files are downloaded instead of played
  • Preventing requests with invalid characters
  • change the way files with certain extensions are utilized
  • use a different file as the index file by specifying the file extension or specific file.

Import Huge Database file in phpMyAdmin


Make sure you change both *”post_max_size”* and *”upload_max_filesize”* in your “php.ini” (which is located where your “php.exe” is or C:\xampp\php\).

The following example allows you to upload and import 128MB sql files:

post_max_size=128M
upload_max_filesize=128M

Restart Apache and you’re all done !!

Difference between Apache server and IIS server


TechThropist Cyber Security

Apache : The Apache HTTP Server, commonly referred to as Apache is a web server software program notable for playing a key role in the initial growth of the World Wide Web.Apache was the first viable alternative to the Netscape Communications Corporation web server (currently named Oracle iPlanet Web Server). Typically Apache is run on a Unix-like operating system,and was developed for use on Linux. Apache is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation.

IIS : Internet Information Services (IIS) – formerly called Internet Information Server – is a web server software application and set of feature extension modules created by Microsoft for use with Microsoft Windows. IIS 7.5 supports HTTP, HTTPS, FTP, FTPS, SMTP and NNTP. It is an integral part of the Windows Server family of products.

Difference between Apache and IIS :

1…

View original post 265 more words

Migrate Wordpress From Localhost To Live Server


You have a working wordpress website on your localhost server and when you need to migrate or copy the same wordpress website to your live server, what should you do ?

To install a fresh copy of wordpress and put all the data again and again is very frustrating.

I think almost all the wordpress developers face this problem. I have a solution to this problem.

There is a very simple way to get rid of this problem.

You just need to download the SQL file from your database and make a copy of your wordpress website folder.

Now open the wp-config.php which is present at the root directory and write the database details you have for your live server.

Now open the SQL file in the editor (I prefer Adobe Dreamweaver), and find http://localhost/yourfoldername/ and replace this with http://www.mywebsite.com/.

You are all done. Just upload the folder through any FTP client and upload the database and enjoy your website fully functional like your local version.