Forum Moderators: phranque

Message Too Old, No Replies

rewriterule bypassing other directories/domains.

rewriterule bypassing other directories

         

justaguynamedrob

11:15 pm on May 13, 2005 (gmt 0)

10+ Year Member



ok,

I'm new to apache, and have a bit of a dilemma. I've browsed around this forum a bit, and could find references to properly adding sub-domains or domains, but not bypassing an existing configuration.

I'm with an excellent hosting company and have 5 domains hosted under 1 account so my directory looks like:


www root /index.php of primary domain (.com)
www root /us/ second domain (.us)
www root /info/ third domain (.info)

etc

Now, I want to use .htaccess to rewrite the index.php files to a logical directory order for search engines without disturbing the existing domains, as they have been configured transparently by the host provider, above my www root directory.

So when I use the below code to rewrite the index.php with the .htaccess in the www root:


RewriteEngine on
RewriteBase /
Options +FollowSymlinks

RewriteRule^directory/$ /index.php?page=thispage

This then hoses up my other domains and sub domains. Is there a simple way to bypass or make the www root .htaccess not affect the other directories or domains/sub-domains?

I'm hoping this is something really simple.

jdMorgan

2:11 am on May 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



rob,

Welcome to WebmasterWorld!

> I'm with an excellent hosting company

You might want to contact them and ask if their default configuration for your account includes:


RewriteOptions Inherit

and if so, ask them to remove that directive from your config. AFAIK, once that has been set, there's not much you can do about it at the .htaccess level, other than putting Rules into .htaccess files in '/us' and '/info' that countermand the Rule in your Web root directory .htaccess, e.g.

RewriteRule ^directory/$ - [L]

(and I'm not sure that will help, either.)

Jim

justaguynamedrob

6:05 am on May 14, 2005 (gmt 0)

10+ Year Member



ok,

I was hoping it was something easy and simple. But it looks like it may be more complicated than hoped. lol, nothing is easy when it comes to webdev/design.

Thanks for the advice/help.

justaguynamedrob

6:26 am on May 14, 2005 (gmt 0)

10+ Year Member



There is one possible way. Put the .com in its own directory and have the hosting company point the domain to that directory so it's isolated from the other domain pointers.

Bingo, by jeeves, that may be the answer here, no complicted .htaccess needed if that can be done. And I see no reason why it can't?

Any follow ups to that idea?

justaguynamedrob

3:46 pm on May 16, 2005 (gmt 0)

10+ Year Member



Good news, it looks like the host providor did the job with the inherit rule. Everything is humming along fine now,

thanks again for the advise.