and one more time... .htacess

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

and one more time... .htacess

Post 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
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

your current rule is looking for alphanumerics only, so it won't find ~smptest
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Where in the directory sturcture is the .htaccess sitting? And how exactly are you trying to call the page? (the URL itself)
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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/
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply