kk,
If the VirtualHost is not setup correctly, you SHOULD have a problem. Same with WP that requires you to let it know where it is (in your file structure). THEN, if your .htaccess code is in your VH’s DocumentRoot, RewriteBase is superfluous.
If you show me your code (httpd-vhosts.conf AND hosts files), I can let you know what the problem is with those. It’s been too long for me with WP so I’ll let you sort it out where you MUST tell WP where it is (no, it doesn’t have GPS ).
When I’ve seen nonsense like your site.com/D:/xampp/htdocs/site.com/page/page, it’s always been immediately resolved with an Apache reboot (to clear accumulated errors, presumably).
@J_B,
Please use care with the metacharacters as the + means one or more and * means zero or more. BOTH metacharacters are “greedy” and that can quickly cause problems.
In kk’s case above, the intention was to match a trailing slash followed by everything which remained in the %{REQUEST_URI} string. In other words, kk did have a path divider (/) and more {crap} in the URI.
In your code, ^(.*)$ IS the same string as %{REQUEST_URI}. Of course, you already knew that because you used the %{REQUEST_URI} string in your RewriteCond statement.
In your gray code, ^(.+)$ will not match the DirectoryIndex of the DocumentRoot unless it’s specified as a file. Requesting http://www.example.com (with or without the trailing slash) is NOT the same thing and that has to be where you had your problem.
Same day, different problem. My problem with (.*) is that it is lazy and will capture NOTHING or EVERYTHING. Too many noobies do not understand how this causes problems for them so telling them it matches everything seems to solve their problem (not matching what they want) but causes so many more problems … so many that my first rant was for this!
[rant #1][indent]The use of “lazy regex,” specifically the :kaioken: EVERYTHING :kaioken: atom, (.*), and its close relatives, is the NUMBER ONE coding error of newbies BECAUSE it is “greedy.” Unless you provide an “exit” from your redirection, you will ALWAYS end up in a loop![/indent][/rant #1]
Okay, the :kaioken: were the old symbols but you get the idea.
Regards,
DK