|
|
|
||||
|
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. |
![]() |
|
|||||||
| Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
|
Thread Tools |
|
|
#1 |
|
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. |
|
|
|
|
|
#2 |
|
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] |
|
|
|
|
|
#3 |
|
Confirmed User
Industry Role:
Join Date: Jul 2008
Location: Los Angeles
Posts: 942
|
Try this :]
RewriteEngine on RewriteRule /(.*)/ index.php?id=$1
__________________
|
|
|
|
|
|
#4 |
|
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.
|
|
|
|
|
|
#5 |
|
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] |
|
|
|
|
|
#6 |
|
Confirmed User
Join Date: Oct 2007
Location: Netherlands
Posts: 415
|
You can do it by just adjusting the pattern to "everything except for /"
Like: Code:
RewriteRule ^/([^/]+)/?$ /index.php?id=$1 [L,NC] |
|
|
|