Sunday, June 27, 2010

How to remove index.php from url using .htaccess (mod_rewrite)


For better SEO optimization and make urls more search engine friendly , remove index.php from URL and make it easier to read.

Remove index.php from URL can be done by writing only two lines in your .htaccess(mod_rewrite in apache) file. Before writingthis rule in .htaccess , make sure that your mod_rewrite is enabled(On) in yourapache server. Most probably mod_rewrite is enabled in Linux server but for windows server , you need to contact hosting people to make mod_rewrite enabled. You can check this by looking in phpinfo().

Below is the Rules which will remove index.php from URL using .htaccess. Look at below links for .htaccess rules.


RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /([^/]+/)*index.php HTTP/ RewriteRule ^(([^/]+/)*)index.php$ http://www.%{HTTP_HOST}/ [R=301,NS,L]

Redirect 301 means Moved Permanently so most search engines will remove index.php from URL.

To know more about programming,MYSQL database,php info,php editor,programming php,Open-source,php help and php script , subscribe to our feed by entering email address below. You will get updates via email about every tutorial posted on this site . It will not take more than a sec.

Redirect one domain to another using .htaccess

Are you looking for redirecting your website fromone domain to another ? I was working for client who has a domain in .com and now they want to move full website into .ie domain. The problem is that all links has been crawled by major search engine. So if we remove all files from .com domain than it shows 404 not found (broken links) for .com domain links. Also we have to remove files to avoid duplicate content issues.

The solution is to redirect all request from .com to .ie. So we need to write rules in .htaccess file of .com domain which redirect all request from .com to .ie and we will not loose the visitors. Below are the rules which is useful forredirecting from one domain to another domain.


Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP_HOST} ^www.olddomain.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]

Comment below if you have any query.

To know more about programming,JavaScript issues,jQuery,Expression Engine,MYSQL database and Open-source, enter your email address below. We will send you free tutorials.


Source link : http://www.programmingfacts.com/2010/03/09/redirect-domain-htaccess/

Thursday, July 31, 2008

Flash - PHP Feedback Form

Flash - PHP Feedback Form. It is easy to create and send your comments with in few seconds..






Paste below codings in your flash action script file.


var sendData_lv:LoadVars = new LoadVars();
var receiveData_lv:LoadVars = new LoadVars();
var formValidated:Boolean;
var errorMessages:Array = new Array();

receiveData_lv.onLoad = function():Void{
trace(this.sent);
if(this.sent == "OK"){
message0_txt.text = "Thank you for your feedback";
}else{
message0_txt.text = this.sent;
}
}


submit_btn.onRelease = function() {
//this clears the error text field if they have been populate previously
clearTextFields();
errorMessages.length = 0; //empty the array so next time the submit button is clicked the array is not already populated
formValidated = checkForm();
if (formValidated) {
//the form is valid and so now we can send details to our PHP file
//populate LoadVars object with the field values
sendData_lv.name = name_txt.text;
sendData_lv.email = email_txt.text;
sendData_lv.feedback = feedback_txt.text;
//trace(sendData_lv.email);
//trace("valid");
sendData_lv.sendAndLoad("email.php?ck="+new Date().getTime(), receiveData_lv);
} else {
//populate textfields with the error messages
for (var i = 0; i _root["message"+i+"_txt"].text = errorMessages[i];
trace(errorMessages[i]);
}
}
};


function checkForm():Boolean {
//check whether the name field is empty
if (name_txt.text == "") {
errorMessages.push("Please enter your name.");
}
if (email_txt.text == "") {
errorMessages.push("Please enter your email address.");
} else if (email_txt.text.indexOf("@") == -1 || email_txt.text.indexOf(".") == -1) {
errorMessages.push("Please enter a valid email address.");
}
if (feedback_txt.text == "") {
errorMessages.push("Please enter some feedback");
}
//if at this point the array is empty i.e has length 0, then this in effect means the form has passed all checks
if (errorMessages.length == 0) {
return true;
} else {
return false;
}
}


function clearTextFields():Void {
for (var i = 0; i _root["message"+i+"_txt"].text = "";
;
}
}


Your Actionscript file is ready then create a phpl file to send your information. The php file names as email.php

$name = $_POST['name'];
$email = $_POST['email'];
$feedback = $_POST['feedback'];
$subject = 'feedback from your website';
$headers = "From: $name <$email>\n";
$headers .= "Reply-To: $name <$email>\n";

//ENTER YOUR EMAIL ADDRESS HERE
$to = 'innovativeidea@gmail.com';
//---------------------------

$success = mail($to, $subject, $feedback, $headers);
if($success){
echo '&sent=OK';
}else{
echo '&sent=Error';
}
?>


 






Wednesday, July 30, 2008

Web 2.0 Badges

Badges are a key requirement for any basic website too. Here is a set of very cool Web 2.0 Badges for you in .PSD and .PNG formats.





***********************************************

Tuesday, July 22, 2008

Get Flash Tips from Me

Hi Friends,
                You can get all tips & tricks using flash actionscript to make a animated screen on your website. If you are a novice then this tutorial will be easier to understand and make you a professional flash designer. Look More from me to get all the tutorials in actionscript

Tuesday, July 15, 2008

For Free Ajax,PHP,Mysql Codings

For free Ajax,php,mysql codings visit : mycodings.blogspot.com. Here you'll get all types of PHP,Ajax Codings & mysql queries .

Flash Slideshow With XML

Paste the below coding in a actionscript file

function loadXML(loaded)
{
if (loaded)
{
xmlNode = this.firstChild;
image = [];
description = [];
linkDetails = [];
total = xmlNode.childNodes.length;
i = 0;
while (i < text =" _root.linkDetails;" content = "no file loaded!" loaded ="=" _alpha =" 0;" text =" description[p];"> 0)
{
--p;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}

function firstImage()
{
if (loaded == filesize)
{
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
link.text = link[0];
picture_num();
}
}

function picture_num()
{
current_pos = p + 1;
pos_txt.text = current_pos + " / " + total;
}

_global.slideshow = "on";
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
//xmlData.load("images.php");
listen = new Object();
listen.onKeyDown = function ()
{
if (Key.getCode() == 37)
{
prevImage();
return;
}

if (Key.getCode() == 39)
{
nextImage();
}

}

Key.addListener(listen);
previous_btn.onRelease = function ()
{
prevImage();
}

next_btn.onRelease = function ()
{
nextImage();
}

p = 0;
this.onEnterFrame = function ()
{
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded == filesize)
{
preloader._visible = false;
if (picture._alpha < _alpha =" picture._alpha" _xscale =" 100" slideshow ="=" now =" getTimer();"> flip)
{
if (p > total - 2)
{
p = 0;
flip = flip + 4000;
firstImage();
return;
}

flip = flip + 4000;
nextimage();
}

}
}

Your Actionscript file is ready then create a xml file with datas in the format given below :
<1?xml version="1.0" encoding="UTF-8">
<1images>
<1pic>
<1image>slideshow/_01.jpg<1/image>
<1caption>ssfsdlfjsdlfjsdla <1/caption>
<1/pic>
<1pic>
<1image>slideshow/_01.jpg<1/image>
<1caption>ssfsdlfjsdlfjsdla <1/caption>
<1/pic>
<1pic>
<1image>slideshow/_01.jpg<1/image>
<1caption>ssfsdlfjsdlfjsdla <1/caption>
<1/pic>

<1/images>
*Remove 1 in every html tag
For demo Check : Liveindiacuisine.com