Your HostICan Community  


Go Back   Your HostICan Community > Programming & Design > PHP / MySQL Assistance

PHP / MySQL Assistance We understand. Not all of you are experienced programmers, but some of you are highly skilled at coding. So we've set aside this forum so you can ask questions, and provide answers to the most commonly asked PHP / MySQL issues.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-13-2008, 09:47 AM
mrugesh78 mrugesh78 is offline
Junior Member
 
Join Date: Oct 2008
Posts: 27
Default .htaccess and redirect rules

hello,

I am in need of ReWriteCond and ReWriteRule for .htaccess file.

here is the question :

i simple want : http://m.readgujarati.com redirect to http://m.readgujarati.com/?page_id=2450

that means whoever types m.readgujarati.com will be redirected to one paticular page.

I wrote :

ReWriteCond %{HTTP_HOST} ^m\.readgujarati\.com$
ReWriteCond %{REQUEST_URI} /
RewriteRule ^(.*)$ http://m.readgujarati.com/?page_id=2450 [R=302,L]

is it correct ? please do some modification in the above for perefect redirect.

from :
mrugesh shah
Reply With Quote
  #2  
Old 10-13-2008, 10:54 AM
GregCotton's Avatar
GregCotton GregCotton is offline
Member
 
Join Date: Sep 2007
Location: Richmond, VA
Posts: 53
Default Re: .htaccess and redirect rules

Check this out:

Redirect to a Different URL using .htaccess
__________________
Thanks,

Greg
HostICan Support Manager

HostICan Tutorials
HostICan Monthly Specials
Reply With Quote
  #3  
Old 10-13-2008, 11:50 AM
mrugesh78 mrugesh78 is offline
Junior Member
 
Join Date: Oct 2008
Posts: 27
Default Re: .htaccess and redirect rules

it will not be helpful to me bcos I have NOT created folder for subdomain. so the only thing I can do with ReWriteCon for "internal redirect"

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^m\.readgujarati\.com
RewriteRule ^$ ?page_id=2450 [R=301,L]

i wrote this but it is creating me two problems. It is showing m.readgujarati.com/sahitya/?page_id=2450 where sahitya is my orginal domains folder. I have pointed my subdomain there. But I donot want to show that in addressbar. I just want to show : m.readgujarati.com/?page_id=2450

and another thing it redirects all internal pages of m.readgujarti.com I want only m.readgujarati.com to be redirected. not internal pages.

please help
Reply With Quote
Reply

Tags
htaccess, redirect, rules

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump


All times are GMT -4. The time now is 07:39 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Copyright © 2003 - 2008 HostICan. All Rights Reserved.