Forum Moderators: phranque
I want to redirect something like this:
http:/www.domain.com/subdir/file.php?a=1&b2
to
http:/www.domain.com/another_subdir/another_file.php?mode=sth&a=1&b2
does anyone know how to do this?
if you place the following in your .htaccess and place it in the root of your website.
(I haven't tested it)
RewriteEngine on
rewriteBase /
rewriteRule ^subdir/file\.php\?(.*) /another_subdir/another_file.php\?mode=sth&$1
assuming that you don't know of mod rewrite:
start by reading:
<snip>
[google.dk...]
and use
[httpd.apache.org...]
as reference.
I hope it helps
/Kasper
[edited by: jdMorgan at 2:10 pm (utc) on Aug. 18, 2005]
[edit reason] Snipped .com URL. [/edit]
RewriteEngine on
RewriteBase /
RewriteRule ^dir1/file1\.php dir2/file2\.php
in my .htacess, but it doesn't work. I get an error 500 (internal server error)
What's more, every page-request is now converted into a 500 Internal Server Error :-(
I'm obviously doing something very stupid, but i don't know what.
I'll take a guess, and suggest that you try this:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^dir1/file1\.php$ /dir2/file2.php [L]
Jim