Jump to content


mod_rewrite per directory basis

  • Please log in to reply
1 reply to this topic

#1 Buyocat

  • Members
  • PipPipPip
  • Advanced Member
  • 267 posts

Posted 18 September 2006 - 08:40 PM

Hi, I can't for the life of me figure out where the problem lies, it is most likely in my httpd.conf file.  What I want is for directory A to have mod rewrite active while directory B (most likely a sub-directory of A) has mod rewrite off.  I have tried accomplishing this with .htaccess files or with directives in the .conf file, but with no luck; all I can do is turn it on or off for everything.  I do this by simply including the rewrite rules and commands at the end of my httpd.conf file...  When I try encasing the rewrite commands in a directive they do not seem to work.  Below is the important stuff in the conf:
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order Deny,Allow
    Deny from all

<Directory "/A">
     Options Indexes FollowSymLinks
     AllowOverride All
     Order allow,deny
     Allow from all
     IndexIgnore *.svn *.cvs *.jpg *.gif *.ico *.htaccess .*

<FilesMatch "^\.ht">    
     Order allow,deny    
     Deny from all    
     Satisfy All

RewriteEngine on
# Some rules follow
# When I put RewriteEngine ... into a directive, such as <Directory A>
# nothing happens
The .htaccess files have either a copy of the RewriteEngine portion, cut from the httpd.conf or a "RewriteEngine off" command; either way they don't seem to do anything; I'm fairly certain they're being read as when I write a .htaccess file with the following in it...
I am confronted with the server error page.

Thanks for your help!
Looking for some easy-to-use tools?  Try these, https://sourceforge....jects/utils-php -- I made them myself.  They're distinct tools which are easy to understand and use.  See some examples uses at http://www.anotherearlymorning.com

#2 vivek

  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 21 September 2006 - 06:56 AM


I want to know that how can it possible to make a dynamic subdomain using .htaccess file and mod_rewrite ?

My idea is,

I want  to redirect http://subdomain.mydomain.com to http://mydomain.com/...hp?id=subdomain

How can this possible in apache's mod rewrite ?

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users