Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 04-26-2010, 03:27 PM   #1
V_RocKs
Damn Right I Kiss Ass!
 
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,422
.htaccess mod_rewrite problem

I would like to set up a site where this happens:

http://www.domain.com/ => loads index normally
http://www.domain.com/this-subdirectory/ => index.php?id=this-subdirectory
http://www.domain.com/anothersub/ => index.php?id=anothersub
http://www.domain.com/whatever/you/put => index.php?=whatever/you/put

I tried various ways of doing it and either ended up in a loop or it didn't work at all. If I used something like /this_never_changes/(+.) I could easily pass the variable, but I need the variable to be the subdirectories themselves.
V_RocKs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-26-2010, 03:30 PM   #2
fatfoo
ICQ:649699063
 
Industry Role:
Join Date: Mar 2003
Posts: 27,763
My suggestion is talk to your host support. I chose justhost.com and they have live support that helped me with my .htaccess issues.
__________________
Send me an email: [email protected]
fatfoo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-26-2010, 03:32 PM   #3
KickAssJesse
Confirmed User
 
KickAssJesse's Avatar
 
Industry Role:
Join Date: Jul 2008
Location: Los Angeles
Posts: 942
Try this :]

RewriteEngine on
RewriteRule /(.*)/ index.php?id=$1
__________________

Contact - email: jesse~AT~atkcash~DOT~com - Skype: kickassjesse - ICQ: 386185547
ATK Cash $$$
KickAssJesse is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-26-2010, 03:47 PM   #4
V_RocKs
Damn Right I Kiss Ass!
 
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,422
The requested URL /google/ was not found on this server.
V_RocKs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-26-2010, 03:58 PM   #5
V_RocKs
Damn Right I Kiss Ass!
 
Industry Role:
Join Date: Dec 2003
Location: Cowtown, USA
Posts: 32,422
This seems to do what I need.

Congrats to all of the winners!

Code:
RewriteRule ^([A-Za-z0-9-]+)/$ index.php?id=$1 [L,NC]
V_RocKs is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-26-2010, 04:03 PM   #6
StariaDaniel
Confirmed User
 
Join Date: Oct 2007
Location: Netherlands
Posts: 415
Quote:
Originally Posted by KickAssJesse View Post
RewriteRule /(.*)/ index.php?id=$1
Quote:
Originally Posted by V_RocKs View Post
RewriteRule ^([A-Za-z0-9-]+)/$ index.php?id=$1 [L,NC]
You can do it by just adjusting the pattern to "everything except for /"

Like:
Code:
RewriteRule ^/([^/]+)/?$ /index.php?id=$1 [L,NC]
StariaDaniel is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 04-26-2010, 05:19 PM   #7
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,372
regex nazis
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.