therealwesfoster Posted November 27, 2008 Share Posted November 27, 2008 I'm having trouble getting this to work for me. I always get a page load error when trying out different .htaccess methods I've found online. None work :/ Here's what I'm trying to do (the underlined words mean they correlate) : Turn http://wes.sitename.com/cars/online/list?id=15 Into ./list.php?name=wes&id=15 So see, I'm wanting to take the subdomain and use it as the first GET var, and anything after /list to be added onto the list.php?name=wes..... A good example of what I'm looking for is used on backpage .com. You'll see the subdomain as well as the additional GET vars. I hope I make sense Quote Link to comment Share on other sites More sharing options...
corbin Posted November 28, 2008 Share Posted November 28, 2008 I would probably set up a wildcard virtualhost in Apache (google it), and then I would make the index file handle requests based on the URI. For example, you could parse the blah out of blah.sitename.com/something and use it in combination with something to handle the request. Oh, this will probably make you laugh a little: http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PALL&p=1&u=/netahtml/PTO/srchnum.htm&r=1&f=G&l=50&s1=6,687,746.PN.&OS=PN/6,687,746&RS=PN/6,687,746 Don't be scared by it though, since I'm fairly sure everyone in the world has ignored it. (Yeah, I just suggested infringing a patent.) Edit: Actually, I think it was revoked in 04 now that I reread that page. Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted December 2, 2008 Author Share Posted December 2, 2008 Ok, I've setup the wildcard subdomains. Working good. Now here's my problem, the page goes on a never-ending loop when I try to load "CITY.SITE.COM". Here's my sample .htaccess Options +FollowSymlinks RewriteEngine On # HAS SUBDOMAIN? RewriteCond %{HTTP_HOST} ^((??!www))[\w-]+)\.SITE\.net [NC] RewriteRule ^((??!online))[\w-]+)/([\w-]+)/mod/([\w-]+) ./$3.php?subdomain=%1&cat=$1&slug=$2 [NC,L,QSA] RewriteRule ^((??!online))[\w-]+)/mod/([\w-]+) ./$2.php?subdomain=%1&cat=$1 [NC,L,QSA] RewriteRule ^online/mod/([\w-]+) ./$1.php?metro=%1 [NC,L,QSA] Any help? Any more info i need to post? Wes Quote Link to comment Share on other sites More sharing options...
corbin Posted December 2, 2008 Share Posted December 2, 2008 Hrmm stupid question. ?! What does that mean? I kno what ?: means (and ? of course), but never seen ?! before. I don't see anything that should cause a never ending loop x.x. Does the error log say what line the loop is? Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted December 2, 2008 Author Share Posted December 2, 2008 ?! is a negative lookahead And there is no error message, firefox stops the process because it's a "never-ending loop". The first part of this top has been solved thanks to the [QSA] flag. I'm still having troubles with the subdomain part though. I'll continue to play with it while I wait for replies. I'll let you know if I figure it out. So until then, help away Wes Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.