Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts

    htaccess works at work but not on my servage account

    I have this htaccess that works for me at work. It uses mod rewrite to convert the folder levels in the url to "Get query strings"

    Code:
    <IfModule mod_rewrite.c>
    	RewriteEngine On
    	RewriteBase /
    	RewriteCond %{query_string} ^(.*)$
    	RewriteRule ^([A-Z][A-Za-z0-9_\.-]+)$  /index.php?top_level=$1&qs=%1 [QSA]
    	RewriteRule ^([A-Z][A-Za-z0-9_\.-]+)/([A-Za-z0-9_\.-]+)$	/index.php?top_level=$1&second_level=$2&qs=%1 [QSA]
    	RewriteRule ^([A-Z][A-Za-z0-9_\.-]+)/([A-Za-z0-9_\.-]+)/([A-Za-z0-9_\.-]+)$  /index.php?top_level=$1&second_level=$2&third_level=$3&qs=%1 [QSA]
       	RewriteRule ^([A-Z][A-Za-z0-9_\.-]+)/([A-Za-z0-9_\.-]+)/([A-Za-z0-9_\.-]+)/([A-Za-z0-9_\.-]+)$  /index.php?top_level=$1&second_level=$2&third_level=$3&forth_level=$4&qs=%1 [QSA]
    </IfModule>
    However on my Servage.net account it doesn't work. htaccess is available on the account and apparently mod rewrite is also supported. Can any one see what's different. Am I doing this the wrong way I know that to get this working at work I have to put certain things in my apache conf like this

    Code:
    <Directory "/home/sites/thisdomain">
    	AllowOverride Options FileInfo
    </Directory>
    
    <IfModule mod_rewrite.c>
    	RewriteEngine On
    	RewriteLog "/home/log/rewrite.log"
    	RewriteLogLevel 3
    	RewriteCond %{REQUEST_METHOD} ^TRACE
    	RewriteRule .* - [F]
    </IfModule>
    I guess servage don't have this in? Is there another way. It must be possible since they state they offer support for mod rewrite.
    You can not say you know how to do something, until you can teach it to someone else.

  • #2
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts
    Nevermind this seems to work

    Code:
    <IfModule mod_rewrite.c>
    	RewriteEngine On
    	RewriteBase /
    	RewriteRule ^([-a-z0-9_]+)/?$ /index.php?level1=$1 [NC,QSA]
    	RewriteRule ^([-a-z0-9_]+)/([-a-z0-9_]+)/?$ /index.php?level1=$1&level2=$2 [NC,QSA]
    	RewriteRule ^([-a-z0-9_]+)/([-a-z0-9_]+)/([-a-z0-9_]+)/?$ /index.php?level1=$1&level2=$2&level3=$3 [NC,QSA]
    	RewriteRule ^([-a-z0-9_]+)/([-a-z0-9_]+)/([-a-z0-9_]+)/([-a-z0-9_]+)/?$ /index.php?level1=$1&level2=$2&level3=$3&level4=$4 [NC,QSA]
    </IfModule>
    Still can't see why the other one doesn't work on servage but does at work. But i found that this one is better than the one at work in many ways. So am happy in a way that it didn't work. Gave me a chance to make a better one. P.S I haven't set this thread to resolved because I still want to know why the other one didn't work?
    Last edited by timgolding; 04-18-2009 at 03:31 AM.
    You can not say you know how to do something, until you can teach it to someone else.


  •  

    Posting Permissions

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