Follow Ohmkumar on Twitter
17
Dec/09
0

Trim .php extension using .htaccess

Trim your .php extension in your web application using .htaccess

RewriteEngine on
RewriteRule ^$ index.php
RewriteRule ^([a-zA-Z0-9\-\_/]*)/$ $1/index.php
RewriteRule ^([a-zA-Z0-9\-\_/]*)$ $1.php

22
Oct/08
0

Domain redirect

Domain redirect

The domain has to be redirected from http://domain.com to http://www.domain.com to stop content duplication.
This has to be done by creating the .htaccess file in the root folder.

creating .htacces file is very simple.

Open a notepad or any text editor copy paste the following code

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^yourdomain.com [nc]
rewriterule ^(.*)$ http://www.yourdomain.com/$1 [r=301,nc]

in that above code modify yourdomain then save the file as .htaccess without any filename

upload the .htaccess file in your root directory.

That is it. Your domain has redirected.