Jump to content
Sign in to follow this  
silexian

comment faire pointer certains fichiers vers un autre domaine ?

Recommended Posts

Bonjour

j'ai fait une gestion multisite pour des sites internet basés sur un CMS (joomla).

L'un de ces sites est celui qui contient tous les fichiers (du CMS).

L'autre contient uniquement 6 fichiers correspondant à la gestion multisite.

Comment faire pour que tous les fichiers hormis ces 6 pointent vers le répertoire où se trouve tous les fichiers ?

Concrètement je me trouve dans /public_html

et le site multisite se trouve dans base/

le second site se trouve dans monsite/

Je souhaite faire quelque chose comme cela dans .htacces du répertoire monsite/:

RewriteCond %{REQUEST_FILENAME} !^/+(index.php|index2.php|index3.php|config.php|configuration.php)$
RewriteRule ^(.*) ../base/$1 [L]

ou bien dans le répertoire /public_html

RewriteCond %{HTTP_HOST} ^www.monsite.com$
RewriteCond %{REQUEST_FILENAME} !^/+(index.php|index2.php|index3.php|config.php|configuration.php)$
RewriteRule ^(.*) base/$1 [L]

mais cela ne marche pas.

J'ai pourtant écrit :

"pour tous les fichiers hors ceux listés dans cette ligne, aller dans le répertoire de base".

Dans mes logs, les fichiers ne sont pas catchés par ce rewrite.

Une petite aide svp ?

Share this post


Link to post
Share on other sites

J'ai enfin trouvé la réponse :)

Je vous la copie en anglais, car cela provient d'une réponse du site de CMS sur lequel j'avais posé la question :

Here is the solution (at least for my problem) :

1. there is www.base.com, which is the URL rattached to the "root" website that supports JMS administration.

2. there is www.mysite1.com which is called in JMS a "subsite" .

3. www.mysite1.com is declared as parked domain in CPanel hosting interface. that way I can access in .htaccess to every directory inside the root directory of my hosting.

4. I have moved www.base from /public_html to /public_html/base for maintenance reasons (easier to update 1 directory, and easier to manage websites as directories, especially the one that is associated with the hosting account

5. Here is the content of .htacces which is located in /public_html.

##############
#Management of www.base.com
##############
#I don't want http://base.com but always http://www.base.com
RewriteCond %{HTTP_HOST} ^base.com$
RewriteRule ^(.*) http://www.base.com/$1 [QSA,L,R=301]
#redirection
RewriteCond %{HTTP_HOST} ^www.base.com$ [NC]
RewriteRule ^(.*) base/$1 [L]

##############
#Management of www.mysite1.com
##############
#I don't want http://base.com but always http://www.mysite1.com
RewriteCond %{HTTP_HOST} ^mysite1.com$
RewriteRule ^(.*) http://www.mysite1.com/$1 [QSA,L,R=301]

#All files listes here are mapped to the subsite directory of www.mysite1.com
RewriteCond %{HTTP_HOST} ^www.mysite1.com$
RewriteCond %{REQUEST_URI} ^/+(initsite.php|index.php|index2.php|index3.php|config.php|configuration.php|db
SitesRules.php)$ [NC]
RewriteCond %{REQUEST_URI} ^/$ [NC]
RewriteCond %{REQUEST_URI} ^$ <--- Have to work on it again , www.mysite1.com and www.mysite1.com/ are not correctly catched...
RewriteRule ^(.*) mysite1/$1 [L]

#All other files not catched above are mapped to the basis directory of the root website www.base.com
RewriteCond %{HTTP_HOST} ^www.mysite1.com$
RewriteRule ^(.*) base/$1 [L]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...