Jump to content

doomwheels

Members
  • Posts

    11
  • Joined

  • Last visited

doomwheels's Achievements

Rookie

Rookie (2/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. >RewriteRule ^(.*)$ [L] You're right, it is a catch-all. What confuses me is that everything breaks without it. The htaccess file in the root causes a 500 error unless the catch-all htacces file is placed in the members dir. Any TCH gurus have an idea why?
  2. Finally working! Now that the server is recognizing my htaccess files, I have been able to test some rewrite rules. The code below seems to be working well and sends any URL containing a subdomain to my members dir plus keeps the subdomain as the user clicks through the files in that dir. htaccess in the root dir: RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] RewriteCond %{HTTP_HOST} ([^.]+)\.example\.com [NC] RewriteRule ^(.*)$ members/$1 [L] However, this alone causes a 500 error unless there is a second htaccess in the members dir. I get that, but the funny thing is that the members htaccess file only requires one short line to work. htaccess in the members dir: RewriteRule ^(.*)$ [L] Just this and nothing else. Seems additional info is ignored, yet it won't work without this bit. Does this make sense to anyone?
  3. If you don't mind, how may I fix this? Thanks in advance.
  4. Sorry, the last line of the code above should be: RewriteRule ^(.*)$ http://www.example.com/members [L,R]
  5. So I guess what I'm trying to figure out first is why code like this is not working in my TCH account: RewriteEngine On RewriteCond %{HTTP_HOST} !^www\.example\.com RewriteCond %{HTTP_HOST} ([^.]+)\.example\.com [NC] RewriteRule ^(.*)$ http://www.example.com/%1 [L,R] I've tried this and each variation posted above with absolutely no affect. When I access my domain with subdomain, it obeys the wildcard DNS but ignores the .htaccess. Any ideas? Any mistakes in this code regarding my application?
  6. Lots. each time a new member registers, they will be assigned a url such as bob.example.com. when they access this URL, I want them to be sent to example.com/members/index.php I already have scripts in place once they arrive. The second step is that I need bob.example.com to continue to show while they brows the files contined in the members dir. Thanks
  7. Andy, there are no subdomins. I simply want to create a rewrite rule so that when someone types in a url containing a subdomain that they arrive at the members dir.
  8. Hi there, Yes, it is a TCH account If you are referring to members/index.php when you say "edit the PHP", I have no problems with what to do once I get the url to resolve to the members dir... but that's the problem. I've tried several rewriterules all with the same result... everything resolves to the home page in the root dir obeying the wildcard DNS yet ignoring the rewriterule of the htaccess file in the root dir. Why is this?
  9. Here's one I'm trying now, but as always... it just resolves to the home page of the root dir: RewriteEngine On RewriteRule ^\.htaccess$ - [F] RewriteCond %{HTTP_HOST} !^www\.example\.com?$ RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com?$ RewriteRule ^$ /members/index.php [L] Really stuck on this one!
  10. Unfortunately not, but thanks. Another problem I'm having is that no matter what type of rules I write in the .htaccess file, it seems to have absolutely no affect whatsoever... even when I write something that should surely cause an error. Weird. Taking one step at a time, I have tried to get blah.example.com to redirect to example.com/members (with no luck) like this (.htaccess loaded to the root dir): RewriteEngine on RewriteCond %{HTTP_HOST} ^([^.]+)\.example\.com RewriteRule (.*) http://www.example.com/members/$1 [R=301,L]
  11. Hi all, I'm trying to setup a rewrite rule set so that when someone tries to access ANY subdomain, they are sent to a specific directory. Not only that, but the original subdomain they typed remains in the browser address bar as they browse each of the directory files. Meaning: 1. user types in bob.example.com 2. user acually arrives at example.com/members.index.php though bob.example.com/index.php appears in the address bar. 3. user clicks on a link to another page in the same dir and the address bar continues to show the subdmain ex: bob.example.com/guestbook.php Is this possible? I already have wildcard setup so that any subdomain resolves to the root. Was this necessary? Perhaps I should begin with the wildcard resolving to the members dir? Any help is greatly appreciated!
×
×
  • Create New...