Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

htaccess rewrite also rewrites subdomains


  • Please log in to reply

#1
tychobarnard

tychobarnard

    Member

  • Member
  • PipPip
  • 17 posts
not sure if i'm posting in the right forum, sorry if i'm not


anyways, i have a problem with rewriting with .htaccess files.

I'm rewriting url's in my root directory:

RewriteEngine OnRewriteBase /RedirectMatch ^/$ /homepagina/RewriteRule ^overons/ index.php?page=overonsRewriteRule ^werkwijze/ index.php?page=werkwijzeRewriteRule ^portfolio/ index.php?page=portfolioRewriteRule ^contact/ index.php?page=contactRewriteRule ^homepagina/ index.php?page=homepaginaRewriteRule ^oplossingen/(.*)/$ index.php?page=oplossingen&sort=$1RewriteRule ^oplossingen/ index.php?page=oplossingenRewriteRule ^whois/ index.php?page=whois

now everything works fine, but the problem is that subdomains also redirect. So if i go to http://sub.mydomain.com/, it also redirects to sub.mydomain.com/homepagina/.

Someone said that uploading an empty htaccess file to the subdomain folder would do the trick; it didn't
Some other guy said an htaccess file containing only "RewriteEngine Off" would do the trick; it didn't

i.e. the redirect only has to work when the user is at www.mydomain.com, not whatever.mydomain.com

its not the end of the world, but it's pretty annoying... anyone know what to do? thanks in advance!

Edited by tychobarnard, 01 August 2009 - 05:13 AM.

  • 0

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP