...

View Full Version : htaccess works at work but not on my servage account



timgolding
04-18-2009, 02:24 AM
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"



<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



<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.

timgolding
04-18-2009, 04:24 AM
Nevermind this seems to work



<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?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum