Back | Reverse |

Apache .htaccess mod rewrite crap
Link | by psoplayer on 2007-05-29 23:29:32
I'm so sick of all of this by now, but I have to turn for help somewhere.
I've scoured the web and can't, for the life of me, find anything remotely helpful. I'm very confident that the solution is very simple, but the combination of regexp and crazy Apache voodoo makes the solution elude me.
What I want to do:
I have wordpress installed in my htdocs folder in its own folder /wp
To get to my wordpress front page, right now is example.com/wp

I want to transparently change that with a .htaccess file so that example.com goes to example.com/wp. Also, example.com/guides needs to rewrite to example.com/wp/guides, and so on for any subdirectory. Basically insert a /wp directory behind anything else, but not infinitely loop and give me a example.com/wp/wp/wp/wp/wp/wp/wp....., as some of my attempts have done. Here is my worthless infinitely rewriting crud attempt:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !^foo(.*)$
RewriteRule ^(.*)$ http://www.example.com/foo/



Re: Apache .htaccess mod rewrite crap
Link | by gendou on 2007-05-30 09:28:43
if you want it transparent you will want to setup a virtual host pointing strait to /wp
alternately, you could just dump the contents of /wp into /
but, if you want to "mix" the namespaces of / and /wp, you can make an alias for each file explicitly.


Re: Apache .htaccess mod rewrite crap
Link | by psoplayer on 2007-05-30 21:36:33
in the end I just went for the lazy fix, and moved everything from /wp to /

maybe I didn't fully understand the uses of mod rewrite?


Re: Apache .htaccess mod rewrite crap
Link | by gendou on 2007-05-31 14:23:27 (edited 2007-05-31 14:24:53)
seems you understand it ok, it's just an impossible task.
you can't make a request for /*.php "check" /wp/*.php and THEN check /*.php.
apache doesn't conditionally find files; they are either in their place or 404.
you might be able to catch the 404 and "handle" it somehow, but thats inefficient and quite silly.
the directories' contents are either separate, aliased (file-by-file), or one-in-the-same.
here, it seems you chose one-in-the-same, which is a fine choice.


Back | Reverse |

Copyright 2000-2025 Gendou | Terms of Use | Page loaded in 0.0008 seconds at 2025-11-17 00:19:18