www.webdeveloper.com
Results 1 to 2 of 2

Thread: Need help constructing this htaccess...

Hybrid View

  1. #1
    Join Date
    Sep 2010
    Posts
    7

    Need help constructing this htaccess...

    Okay... I'm not exactly sure if what I'm trying to do is possible...

    Lets say I have a website at:
    website.com/dir/

    Then I also have a sub directory at:
    website.com/dir/portal/

    What I want to do... if someone goes to /dir/, I want them to get forwarded to /dir/portal/

    Then if someone goes to /dir/forum/, I want them forwarded to /dir/

    So the route would be:
    /dir/ => /dir/portal/
    /dir/forum/ => /dir/



    This is my current htaccess...
    Code:
    ## Expires
    <ifModule mod_expires.c>
    	ExpiresActive On
    	ExpiresDefault "access plus 1 seconds"
    	ExpiresByType text/html "access plus 1 seconds"
    	ExpiresByType image/gif "access plus 3456000 seconds"
    	ExpiresByType image/jpeg "access plus 3456000 seconds"
    	ExpiresByType image/png "access plus 3456000 seconds"
    	ExpiresByType text/css "access plus 3456000 seconds"
    	ExpiresByType text/javascript "access plus 3456000 seconds"
    	ExpiresByType application/javascript "access plus 3456000 seconds"
    	ExpiresByType application/x-javascript "access plus 3456000 seconds"
    </ifModule>
    
    ## Compression
    <ifmodule mod_headers.c>
    	<ifmodule mod_deflate.c>
    		AddOutputFilterByType DEFLATE text/html text/css text/xml application/x-javascript
    		BrowserMatch ^Mozilla/4 gzip-only-text/html
    		BrowserMatch ^Mozilla/4\.0[678] no-gzip
    		BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    	</ifmodule>
    </ifmodule>
    
    ## Rewrites
    <IfModule mod_rewrite.c>
    	RewriteEngine On
    
    	RewriteCond %{REQUEST_FILENAME} -f [OR]
    	RewriteCond %{REQUEST_FILENAME} -l [OR]
    	RewriteCond %{REQUEST_FILENAME} -d
    	RewriteRule ^.*$ - [NC,L]
    	RewriteRule ^(data|js|styles|install) - [NC,L]
    	RewriteRule ^.*$ index.php [NC,L]
    </IfModule>

  2. #2
    Join Date
    Oct 2010
    Posts
    3
    why dont you add an index.php to the dirs that need redirection with a header in it?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles