Forum Moderators: phranque
machine details:
OS: win xp pro SP2
Server: WampServer 2.0c (apache 2.2.8)
rewirte goal:
simple test redirection (foo.html to bar.php)
problem:
after redirection, apache point to the document root (c:/wamp/www/) for destination page (not in alias directory)
apache alias.conf:
Alias /sample/ 'd:/web/sample.com/www/' <Directory 'd:/web/sample.com/www/' > Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny Allow from all </Directory> .htaccess file:
Options -Indexes -MultiViews RewriteEngine On RewriteBase / RewriteRule ^foo.html$ /bar.php [NC,L] rewrite.log:
strip per-dir prefix: d:/web/sample.com/www/foo.html -> foo.html applying pattern '^foo.html$' to uri 'foo.html' rewrite 'foo.html' -> '/bar.php' trying to replace prefix d:/web/sample.com/www/ with / internal redirect with /bar.php [INTERNAL REDIRECT] Apache_error.log:
script 'C:/wamp/www/bar.php' not found or unable to stat I’m trying every thing that find in search engine and technical forums. Also I changed the RewriteBase and Flag(s) for many times, but any solutions not worked.
.htaccess options (such as –MultiViews) was changed and I test the RewriteRule like below (without backslash befor bar.php and NC flag) :
RewriteRule ^foo.html$ bar.php [L] When backslash removed
rewrite.log:
strip per-dir prefix: d:/web/sample.com/www/foo.html -> foo.html applying pattern '^foo.html$' to uri 'foo.html' rewrite 'foo.html' -> '/bar.php Apache_error.log:
Invalid URI in request GET /sample/foo.html HTTP/1.1 Any help appreciated,
thanks
After I copy my project files in a “test” folder in “c:/wamp/www/” and change RewriteBase to “/test/” rewrite rules work perfectly but I decide to switch a *nix like environment for development (matching local machine and remote server).
thanks again for your reply :-*