Hi,
I would grateful if someone can help me with this matter.
I have a URL and I want to redirect it to the index.php.
This is the URL
http://www.smslanka.com/index.php?optio ... view=reset
and I want to redirect that to the
http://smslanka.com/index.php
Please if you know about this matter write to me as soon as possible.
Regards,
Sugith Karunatahne
http://www.eyepax.com
rewrite a URL
Moderator: General Moderators
Re: rewrite a URL
You can try this code, put it in top of the page.
Code: Select all
<?php
if (strstr($_SERVER['HTTP_HOST'],"www."))
{
header("Location:http://".$_SERVER['HTTP_HOST']."/?".$_SERVER['QUERY_STRING']);
}
?>
Re: rewrite a URL
can you tell me how do I have to fix that using the .htaccess file.
I used this code in the htaccess file but it didn't work.
Redirect 301 ^index.php?option=com_user&view=reset$ http://abc.com/index.php
Regards,
Sugith Karunaratne
http://www.eyepax.com
I used this code in the htaccess file but it didn't work.
Redirect 301 ^index.php?option=com_user&view=reset$ http://abc.com/index.php
Regards,
Sugith Karunaratne
http://www.eyepax.com
Re: rewrite a URL
Try this
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]