Page 1 of 1

and one more time... .htacess

Posted: Sun Mar 12, 2006 6:21 am
by s.dot
I have a few different websites up on my server

/home/scott
/home/test_ac
and /home/smptest

Now, my mod rewrite rules work on the first 2, as they have a domain name, but the one i'm working on now (developing it still) is using a URL like..

http://my.server.ip.here/~smptest/index.php

Should my mod rewrite rules be affected by that? Currently I have this rule and it's not working

Code: Select all

RewriteEngine on
RewriteRule ^([a-zA-Z0-9_-]+)(/)?$ /showme.php?u=$1

Posted: Sun Mar 12, 2006 8:41 am
by feyd
your current rule is looking for alphanumerics only, so it won't find ~smptest

Posted: Sun Mar 12, 2006 9:15 am
by s.dot
ah, I thought since it was in the ~smptest/ directory, that my rewrite rule should look for anything after that.. I didn't know I would have to include ~smptest/ in the rewrite rule. thanks.

Posted: Sun Mar 12, 2006 11:05 am
by s.dot

Code: Select all

RewriteEngine On
RewriteRule ^/~smptest/([a-zA-Z0-9_-]+)(/)?$ showme.php?u=$1
and

Code: Select all

RewriteEngine On
RewriteRule ^~smptest/([a-zA-Z0-9_-]+)(/)?$ showme.php?u=$1
Doesn't work either. unless something in the ~smptest/ is triggering the regex I cannot see why.

Posted: Sun Mar 12, 2006 11:10 am
by feyd
Where in the directory sturcture is the .htaccess sitting? And how exactly are you trying to call the page? (the URL itself)

Posted: Sun Mar 12, 2006 11:19 am
by s.dot
The .htacess is in

/home/smptest/public_html/

The page I'm trying to call is http://my.server.ip.addr/~smptest/scott

http://my.server.ip.addr/~smptest/ points to /home/smptest/public_html/

Posted: Sun Mar 12, 2006 11:22 am
by s.dot
However, this solution works.

Code: Select all

RewriteRule ^([a-zA-Z0-9_-]+)(/)?$ http://my.server.ip.addr/~smptest/showme.php?u=$1
as does

Code: Select all

RewriteRule ^([a-zA-Z0-9_-]+)(/)?$ /~smptest/showme.php?u=$1
I think i was rewriting the url to a different directory.