![]() |
.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. |
My suggestion is talk to your host support. I chose justhost.com and they have live support that helped me with my .htaccess issues.
|
Try this :]
RewriteEngine on RewriteRule /(.*)/ index.php?id=$1 |
The requested URL /google/ was not found on this server.
|
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] |
Quote:
Quote:
Like: Code:
RewriteRule ^/([^/]+)/?$ /index.php?id=$1 [L,NC] |
regex nazis
|
| All times are GMT -7. The time now is 12:28 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123