Tech Reviews, Guides, Articles, and Forums for PC Hardware, Modding, and Gaming Enthusiasts
Fury-Tech Forums

Go Back   Fury-Tech Forums > Software Forums > Graphics, Web Design, CSS & Scripting
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

New to Fury-Tech Forums? Register now for free!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-27-2005, 12:56 PM
mopain's Avatar
Great Diviner
Great Diviner
 
Join Date: Aug 2002
Location: Portland,Me
Posts: 1,253
Rep Power: 8
mopain is on a distinguished road
Send a message via AIM to mopain Send a message via MSN to mopain
Default Mod Rewrite is driving me insane!!

Okay I need something very simple... and for some reason I just cant get it to work the way I want too..so heres my issue.

I have a domain , and the website content ,etc is located in a subdirectory off the domain ie. "http://mydomain.com/subdir"
what I want is for mod rewrite to fool browsers ,etc into the thinking that its all located under "http://mydomain.com"
right now I have it setup so when u go to http://mydomain.com it imediately drops you in the "http://mydomain.com/subdir" and then the website, but for better SEO purposes , and other personal reasons I want to eliminate the "/subdir/" all completely from the URL...I hope this is making sense so far... I'm at work and do not have FTP access so I cant post my current .htaccess file unfortunately...
__________________
Web Master Directory
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 09-27-2005, 01:33 PM
Technophile's Avatar
Super Moderator
Great Diviner
 
Join Date: Sep 2002
Location: Everywhere
Posts: 3,803
Rep Power: 10
Technophile is on a distinguished road
Send a message via AIM to Technophile Send a message via MSN to Technophile Send a message via Yahoo to Technophile
Default

Sort of guessing you probably want something like this:

Code:
RewriteEngine on
RewriteRule ^/subdir(/)?$ /
But I'd know better if I saw what you were doing. I haven't used mod_rewrite before myself but it looks pretty simple. The regex's are the confusing part.

Oh, btw that regex should catch "/subdir" or "/subdir/". If you want to rewrite ANYTHING with "/subdir" in it, try removing the '^' and '$' characters.
__________________
Your sig is cooler than mine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 09-29-2005, 03:21 PM
mopain's Avatar
Great Diviner
Great Diviner
 
Join Date: Aug 2002
Location: Portland,Me
Posts: 1,253
Rep Power: 8
mopain is on a distinguished road
Send a message via AIM to mopain Send a message via MSN to mopain
Default

will that hide the sub dir from the user??...
__________________
Web Master Directory
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-29-2005, 06:39 PM
Technophile's Avatar
Super Moderator
Great Diviner
 
Join Date: Sep 2002
Location: Everywhere
Posts: 3,803
Rep Power: 10
Technophile is on a distinguished road
Send a message via AIM to Technophile Send a message via MSN to Technophile Send a message via Yahoo to Technophile
Default

No, it won't. Like I said it was a guess and I'd never used mod rewrite before. I think what you need to do is actually something like this:

Code:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^$ subdir/
The FollowSymlinks option must be enabled for any rules to work. It's probably already enabled, but it doesn't hurt to specify it here as well. RewriteEngine On turns rewrite on of course. RewriteRule matches "" (nothing) after / (http://mydomain.com/), and redirects it to "subdir/". The URL that the user sees in their browser is still http://mydomain.com/. This time I had a way of testing it. It worked for me.
__________________
Your sig is cooler than mine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 09-29-2005, 06:56 PM
mopain's Avatar
Great Diviner
Great Diviner
 
Join Date: Aug 2002
Location: Portland,Me
Posts: 1,253
Rep Power: 8
mopain is on a distinguished road
Send a message via AIM to mopain Send a message via MSN to mopain
Default

sweet!! I havnt tested it yet but very nice!! if it worked for you ... how did u figure it out? any particular websites that I missed??
__________________
Web Master Directory
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 09-29-2005, 07:33 PM
Technophile's Avatar
Super Moderator
Great Diviner
 
Join Date: Sep 2002
Location: Everywhere
Posts: 3,803
Rep Power: 10
Technophile is on a distinguished road
Send a message via AIM to Technophile Send a message via MSN to Technophile Send a message via Yahoo to Technophile
Default

I pretty much looked at this page:
http://corz.org/serv/tricks/htaccess2.php
and this page:
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

In my original post I had the wrong idea entirely and was trying to do it pretty much backwards. After realizing how it worked I got hung up because I was trying to match on ^/$. Apparently that works if you are doing it from httpd.conf, but not if you are doing it from .htaccess. When doing it from .htaccess you are limited to the local path which does not include the first "/" (if the .htaccess file was in /subdir/, the local path would start inside /subdir/). Also, trying to substitute "/subdir" wouldn't work because that apparently tries to go to "subdir" in "/" (the root of the drive), and doesn't just substitute "/subdir" for "/" in the URL. This stuff is definitely a lot more confusing than it looked at first glance. But after reading the docs a little bit it does pretty much make sense now.
__________________
Your sig is cooler than mine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 09-30-2005, 08:54 PM
mopain's Avatar
Great Diviner
Great Diviner
 
Join Date: Aug 2002
Location: Portland,Me
Posts: 1,253
Rep Power: 8
mopain is on a distinguished road
Send a message via AIM to mopain Send a message via MSN to mopain
Default

cool that works like a charm btw!
__________________
Web Master Directory
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 09-30-2005, 10:01 PM
Technophile's Avatar
Super Moderator
Great Diviner
 
Join Date: Sep 2002
Location: Everywhere
Posts: 3,803
Rep Power: 10
Technophile is on a distinguished road
Send a message via AIM to Technophile Send a message via MSN to Technophile Send a message via Yahoo to Technophile
Default

Sweet.
__________________
Your sig is cooler than mine.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Viewing
Go Back   Fury-Tech Forums > Software Forums > Graphics, Web Design, CSS & Scripting


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
A great driving vid. Gotfolk Jibber Jabber 2 05-19-2004 12:23 AM


All times are GMT -5. The time now is 10:49 PM.


PHP Scripts
BidVerve Directory
PageRank Script
SEO Scripts
37 SEO Scripts
List Cleaner Script
Keyword Cleaner
Directory Script
Directory Script

Directories
BidVerve Directory
BidVerve Directory
Nerve Directories
Nerve Directories
Directory Grow
Directory Grow

Our Supporters
entertainment sites
online casino

Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.1.0 ©2007, Crawlability, Inc.