multiple rewrite

Discussions about Apache mod Rewrite, .htaccess, Use, experiences ... URL Rewriting.

Moderator: Moderators

multiple rewrite

Postby Snk » Wed Nov 08, 2006 10:00 am

Hi, I've a question about 2 subdomains where are there installed 2 phpbb

support.domain.com
friends.domain.com

I've put the .htaccess on a support folder like /../domain/public_html/support/

with that code:

Code: Select all
Options +FollowSymlinks
RewriteEngine On
RewriteBase /

#########################################################
# supporto SEO REWRITE RULES            #
#########################################################
# AUTHOR : DCZ http://www.supporto-seo.com/
# STARTED : 01/2006
#####################################################
# FORUMS PAGES
########################
# FORUM PROTECTION RULE
RewriteRule ^.+/([^/]+\.html)$ /index.php [R=301,L]
# CATEGORIES
RewriteRule ^.+-vc([0-9]+)\.html$ /index.php?c=$1 [QSA,L]
# PAGINATED FORUM
RewriteRule ^.+-vf([0-9]+)-([0-9]+)\.html$ /viewforum.php?f=$1&start=$2 [QSA,L]
# FORUM
RewriteRule ^.+-vf([0-9]+)\.html$ /viewforum.php?f=$1 [QSA,L]
# PAGINATED TOPIC
RewriteRule ^.+-vt([0-9]+)-([0-9]+)\.html$ /viewtopic.php?t=$1&start=$2 [QSA,L]
# TOPIC
RewriteRule ^.+-vt([0-9]+)\.html$ /viewtopic.php?t=$1 [QSA,L]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L]
#PROFILES
RewriteRule ^member([0-9]+)\.html$ /profile.php?mode=viewprofile&u=$1 [QSA,L]
# END supporto PAGES
#####################################################

and alla works perfectly.
It's the first time that I install modrewrite on subdomain an I've put the file on /support/ folder like "root" without any /namefolder/ redirections on .htaccess file.

I've a question, if I create another subdomine like friends.domain.com in a folder path like /../domain/public_html/friends/ and with another .htaccess (the same of support folder) can I use modrewrite on the 2 forums?
And on root I just put the robots.txt file like that:
Code: Select all
User-agent: *
Disallow: /support/viewtopic.php
Disallow: /support/viewforum.php
Disallow: /support/index.php?
Disallow: /support/posting.php
Disallow: /support/groupcp.php
Disallow: /support/search.php
Disallow: /support/login.php
Disallow: /support/post
Disallow: /support/member
Disallow: /support/profile.php
Disallow: /support/memberlist.php
Disallow: /support/faq.php
Disallow: /friends/viewtopic.php
Disallow: /friends/viewforum.php
Disallow: /friends/index.php?
Disallow: /friends/posting.php
Disallow: /friends/groupcp.php

that's right?

thx
Snk
 
Posts: 4
Joined: Wed Nov 08, 2006 12:08 am

Advertisement

Postby dcz » Wed Nov 08, 2006 10:14 am

You can add as many forum as your server can handle, remember that if they are all installed in a different sub domains, it's exactly like if they where totally independent.

The fact you install these sub domain in the man domain folder is what makes it possible for an extra access from the main domain. But it's this to be the exception, not the contrary. It's just because the physical files are located in a folder being available under two domains.

So in every sub domains folder, it work the same.

In every of them, you should implement the www prefix redirection (option number 2).

Then, in the main domain's .htaccess, you should add :

Code: Select all
RewriteCond %{REQUEST_URI} support/(.*) [NC]
RewriteRule ^(.*) http://support.example.com/%1 [QSA,L,R=301]


and etc for all sub domains installed in the main domain's root sub-folders.

This way, any call to www.example.com/support/*.* will be HTTP 301 redirected to http://support.example.com/*.*.

Talking about robots.txt, it's the same, the only one active for a domain is the one located at his root. You thus need again to add one robots.txt (with path starting from sub domain's root) per sud-domain, no matter if they are installed in a main domain's sub-folder.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21428
Joined: Fri Apr 28, 2006 9:03 pm

Postby Snk » Wed Nov 08, 2006 2:16 pm

Ok thanks :)
Snk
 
Posts: 4
Joined: Wed Nov 08, 2006 12:08 am

Postby dcz » Wed Apr 18, 2007 7:36 pm

Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21428
Joined: Fri Apr 28, 2006 9:03 pm


Return to Apache mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 8 guests