Some problems

Using a single web hosting account to host multiple sites

..:: New Domain ::..

Postby torgheh » Sat Nov 01, 2008 11:40 pm

hi
here I have this new domain: “naimi.ir”

in the root I have an “index.html” file and I want to redirect all of these addresses
Code: Select all
www.naimi.ir
www.naimi.ir/index.html
naimi.ir/index.html
naimi.ir

to
Code: Select all
www.naimi.ir

in the root I have another “html” files like “art-gallery.html” , “design.html” etc

and for example I want to redirect these addresses :
Code: Select all
naimi.ir/art-gallery.html
www.naimi.ir/art-gallery.html

to
Code: Select all
www.naimi.ir/art-gallery.html

and another addresses like above example

would you please help me to have a right .htaccess file and redirect all addresses ?

i have a folder named “blog” and it I have installed a cms in this folder
the main page of this cms is “naimi.ir/blog/index.php” and it has another pages like
naimi.ir/blog/xxx or naimi.ir/categories/xxx/xxx

I want redirect these addresse
Code: Select all
naimi.ir/blog/index.php
www.naimi.ir/blog/index.php

to
Code: Select all
www.naimi.ir/blog/index.php

and all other pages like
Code: Select all
www.naimi.ir/blog/xxx
and
naimi/ir/blog/xxx
or
www.naimi.ir/blog/catagories/xxx/xxx
and
naimi.ir/blog/catagories/xxx/xxx

to
Code: Select all
www.naimi.ir/blog/xxx
www.naimi.ir/blog/catagories/xxx/xxx



is this code in the root’s .htaccess file a correct code?
Code: Select all
RewriteRule ^blog/?$      http://www.naimi.ir/blog/index.php      [R=301,L]


or I need another code?

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

Postby richardk » Sun Nov 02, 2008 2:07 pm

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{THE_REQUEST} \ /index\.html(\?.*)?\  [NC,OR]
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(index\.html)?$ http://www.example.com/? [R=301,L]

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

Postby torgheh » Tue Nov 11, 2008 3:12 am

hi

in the root i have this code

Code: Select all
Options +FollowSymLinks

RewriteEngine On

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

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


and in the "gallery" sub folder i have this code

Code: Select all

##  ********************************************
##  Coppermine Photo Gallery
##  ************************
##  Copyright (c) 2003-2007 Coppermine Dev Team
##  v1.1 originaly written by Gregory DEMAR
##
##  This program is free software; you can redistribute it and/or modify
##  it under the terms of the GNU General Public License version 3
##  as published by the Free Software Foundation.
## 
##  ********************************************
##  Coppermine version: 1.4.13
##  $Source$
##  $Revision: 3837 $
##  $Author: gaugau $
##  $Date: 2007-08-16 18:56:06 +0200 (Do, 16 Aug 2007) $
##  ********************************************

Options FollowSymLinks SymLinksIfOwnerMatch

RewriteEngine on

#  Uncomment the following line if your webserver's
#  URL is not directly related to physical file paths.
#  Update "YOUR_COPPERMINE_ROOT" (just / for root)

#RewriteBase /YOUR_COPPERMINE_ROOT

#
# Rewrite index urls
#
RewriteRule index-([0-9]*)\.html index.php?cat=$1 [NC]

RewriteRule index-([0-9]*)-page-([0-9]*)\.html index.php?cat=$1&page=$2 [NC]

#
# Rewrite thumbnail urls
#
RewriteRule thumbnails-([a-z0-9]*)-([\-]?[0-9]*)\.html thumbnails.php?album=$1&cat=$2 [NC]

RewriteRule thumbnails-([a-z0-9]*)-page-([0-9]*)\.html thumbnails.php?album=$1&page=$2 [NC]

RewriteRule thumbnails-([a-z0-9]*)-([\-]?[0-9]*)-page-([0-9]*)\.html thumbnails.php?album=$1&cat=$2&page=$3 [NC]

RewriteRule thumbnails-([0-9a-z]*)\.html thumbnails.php?album=$1 [NC]

RewriteRule thumbnails-search-(.*)\.html thumbnails.php?album=search&search=$1 [NC]


#
# Rewrite displayimage urls
#
RewriteRule displayimage-([a-z0-9]+)-([\-]?[0-9]+)-([\-]?[0-9]+)\.html displayimage.php?album=$1&cat=$2&pos=$3 [NC]

RewriteRule displayimage-([a-z0-9]+)-([\-]?[0-9]+)\.html displayimage.php?album=$1&pos=$2 [NC]

RewriteRule displayimage-([0-9]+)\.html displayimage.php?pos=-$1 [NC]

RewriteRule slideshow-([0-9]+)-([\-]?[0-9]+)-([0-9]+)\.html displayimage.php?album=$1&pid=$2&slideshow=$3 [NC]

RewriteRule slideshow-([a-z]+)-([\-]?[0-9]+)-([0-9]+)-([0-9]+)\.html displayimage.php?album=$1&cat=$2&pid=$3&slideshow=$4 [NC]



the code in the gallery subfolder included for "sef_url" plugin

and i have a problem

this code of root

Code: Select all
RewriteRule ^gallery/?$ http://www.toranj-gem.com/gallery/index.php [R=301,L]


dont work correctly

how can i fix this problem to redirect these addresses

Code: Select all
www.toranj-gem.com/gallery/index.php
toranj-gem.com/gallery/index.php
toranj-gem.com/gallery
www.toranj-gem.com/gallery


to this one

Code: Select all
www.toranj-gem.com/gallery/index.php


would you help me please?
torgheh
 
Posts: 16
Joined: Thu Oct 09, 2008 5:23 am

Postby richardk » Wed Nov 12, 2008 12:15 pm

Try adding
Code: Select all
RewriteRule ^$ http://www.toranj-gem.com/gallery/index.php [R=301,L]

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

after
Code: Select all
#RewriteBase /YOUR_COPPERMINE_ROOT

(In /gallery/.htaccess.)
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby torgheh » Wed Nov 12, 2008 10:08 pm

thank you my problem is fixed
torgheh
 
Posts: 16
Joined: Thu Oct 09, 2008 5:23 am

Postby torgheh » Sun Dec 07, 2008 10:00 am

Hi
Here we have lot of problems!

We have this domain p30lords.com

In the root we have a cms containing many pages

I want to redirect all of these addresses:

www.example.com
www.example.com/index.php
example.com
example.com/index.php

to

www.example.com

and redirect these addresses
www.example.com/xxxxxxxx.php
example.com/xxxxxxxx.php

to
www.example.com/xxxxxxxx.php


we have a forum in the /forum folder

i want redirect these addresses :

www.example.com/forum
www.example.com/forum/index.php
example.com/forum
example.com/forum/index.php

to

www.example.com/forum/index.php


subdomains

we have lot of sub domains like “bkm”, “torgheh” etc

I want redirect my subdomain addresses with “www” to subdomains without “www”

Example :
Redirect these addresses :
www.bkm.example.com
bkm.example.com
www.example.com/bkm
example.com/bkm

to this one

bkm.example.com

and all other subdomains like above subdomain example

would you plz give me the right “.htaccess” file?

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

Postby richardk » Mon Dec 08, 2008 12:19 pm

You should take the time to learn to use mod_rewrite.

What have you tried so far?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Previous

Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 22 guests

cron