Some problems

Using a single web hosting account to host multiple sites

Some problems

Postby torgheh » Thu Oct 09, 2008 5:49 am

hi all

i have this domain
-www.toranj-gem.com

it is working with plesk contol panel and do not have redirect option!

in the root folder (httpdocs) i have "index.html" is intro page & "index.php"

the index.php is main page of a cms

i want to lock www and index.html when users visit my website for the first time and then when them visits index.php "www" is lock for other pages !

is it possible ?

i am using this code in the root's .htaccess file

Code: Select all
RewriteEngine on
RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.toranj-gem\.com$ [NC]
RewriteRule ^(.*) http://www.toranj-gem.com/$1 [QSA,L,R=301]

RewriteRule ^$ http://www.toranj-gem.com/index.php [QSA,L,R=301]


---------------

another problem :

i have a subfolder in the root named "en"
and i was installed a new cms in this folder
i want to lock www and index.php for this cms too
and finally i have this address

-www.toranj-gem.com/en/index.php

how can i do this ?

i am using this code in the "en" 's .htaccess file

Code: Select all
RewriteEngine On
RewriteBase /


RewriteRule ^$ http://www.toranj-gem.com/en/index.php [QSA,L,R=301]


and this code locks the "index.php" for both this to addresses

-toranj-gem.com/en/index.php
-www.toranj-gem.com/en/index.php

but i want one of this addresses (-www.toranj-gem.com/en/index.php)

so if possible plz incude the correct codes for me here

tnx
torgheh
 
Posts: 16
Joined: Thu Oct 09, 2008 5:23 am

Postby richardk » Thu Oct 09, 2008 11:24 am

What do you mean by lock? Are you trying to stop the URL from changing? You can't do that with mod_rewrite, you would need a frame.

For the www. part
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.toranj-gem\.com$ [NC]
RewriteRule ^(.*)$ http://www.toranj-gem.com/$1 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby torgheh » Thu Oct 09, 2008 11:45 am

thanks for your answer

What do you mean by lock?


i mean i want this address finally:

www.toranj-gem.com/index.html

and not this one : toranj-gem.com/index.html

-------------
this is code is included in my root's .htaccess file and i have not problem about this one

Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www\.toranj-gem\.com$ [NC]
RewriteRule ^(.*)$ http://www.toranj-gem.com/$1 [R=301,L]


my problem is about redirecting my main domain to the "index.html"

--------------------------

and how about the "en" sub folder

for example plz visit this site :

www.phpbb-seo.com/boards/index.php

i want my "en" page to be like this address
torgheh
 
Posts: 16
Joined: Thu Oct 09, 2008 5:23 am

Postby richardk » Thu Oct 09, 2008 12:09 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^$ /index.html [QSA,L]

RewriteRule ^en/index\.php$ http://www.toranj-gem.com/en/ [R=301,L]

RewriteCond %{HTTP_HOST} !^www\.toranj-gem\.com$ [NC]
RewriteRule ^(.*)$ http://www.toranj-gem.com/$1 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby torgheh » Thu Oct 09, 2008 12:33 pm

thnks a lot

problem for index.html is fixed


but in this address i have these to addresse

toranj-gem.com/en/index.php
www.toranj-gem.com/en/index.php

and i want to have the second means (www.toranj-gem.com/en/index.php)
and first address and /* adresses redirect to address that have www

can u help me plz

thanks
torgheh
 
Posts: 16
Joined: Thu Oct 09, 2008 5:23 am

Postby richardk » Thu Oct 09, 2008 2:24 pm

Do you have a .htaccess file in /en? Try removing it.

Or try adding
Code: Select all
RewriteCond %{HTTP_HOST} !^www\.toranj-gem\.com$ [NC]
RewriteRule .* http://www.toranj-gem.com%{REQUEST_URI} [R=301,L]

to the /en/.htaccess file.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby torgheh » Thu Oct 09, 2008 2:41 pm

when i have added this code

Code: Select all
RewriteCond %{HTTP_HOST} !^www\.toranj-gem\.com$ [NC]
RewriteRule .* http://www.toranj-gem.com%{REQUEST_URI} [R=301,L]


tor en/.htaccess

the "www" problem fixed

but redirect to index.php is not work

& i have these to addresses now

www.toranj-gem.com/en
&
www.toranj-gem.com/en/index.php
torgheh
 
Posts: 16
Joined: Thu Oct 09, 2008 5:23 am

Postby richardk » Thu Oct 09, 2008 2:46 pm

Do you want /en/ and /en redirected to /en/index.php or do you want /en/index.php and /en redirected to /en/?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby torgheh » Thu Oct 09, 2008 2:51 pm

richardk wrote:Do you want /en/ and /en redirected to /en/index.php or do you want /en/index.php and /en redirected to /en/?


i want first one

/en/ and /en redirect to /en/index.php
torgheh
 
Posts: 16
Joined: Thu Oct 09, 2008 5:23 am

Postby richardk » Thu Oct 09, 2008 2:55 pm

Try the following in a /.htaccess
Code: Select all
DirectoryIndex index.html index.php
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^$ /index.html [QSA,L]

RewriteCond %{HTTP_HOST} !^www\.toranj-gem\.com$ [NC]
RewriteRule .* http://www.toranj-gem.com%{REQUEST_URI} [R=301,L]


and the following in /en/.htaccess
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^$ /en/index.php [R=301,L]

RewriteCond %{HTTP_HOST} !^www\.toranj-gem\.com$ [NC]
RewriteRule .* http://www.toranj-gem.com%{REQUEST_URI} [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Next

Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 17 guests

cron