Hi, I want to redirect all the old file reference from old directory to new dir. for ex. I want the following file references: domain.com/old_dir/file1.html domain.com/old_dir/file2.html domain.com/old_dir/file3.html to the following domain.com/newdir/search.php?item=file1 domain.com/newdir/search.php?item=file2 domain.com/newdir/search.php?item=file3 If I cannot get the above then at least I want the following: domain.com/old_dir/file1.html domain.com/old_dir/file2.html domain.com/old_dir/file3.html to be redirected to the following: domain.com/newdir/ How do I accomplish this? Thanks!
Not sure about what kind of redirect you want. I assume that all what you need is to rewrite the URL's without any redirect. Options +FollowSymlinks RewriteEngine on RewriteRule ^old_dir\/(.*)\.html$ /newdir/search.php?item=$1 [L] Code (markup): Jean-Luc
This did not work. What type of redirects are there? The old_dir does not exist but there are URLs in the search engines and that's why I want the visitors to be redirected to the new URL.
hi Redirect 301 /oldpage.html http://www.example.com/newpage.html Code (markup): this should do the trick
It is actually many pages from old dir needs to be redirected to specific new dir pages. Here's an example; The following pages: domain.com/old_dir/file1.html domain.com/old_dir/file2.html domain.com/old_dir/file3.html should be redirected to the following pages domain.com/newdir/search.php?item=file1 domain.com/newdir/search.php?item=file2 domain.com/newdir/search.php?item=file3
Well then just do the same as above just for every page you need it for example Redirect 301 /old_dir/file1.html domain.com/newdir/search.php?item=file1 Redirect 301 /old_dir/file2.html domain.com/newdir/search.php?item=file2 Redirect 301 /old_dir/file3.html domain.com/newdir/search.php?item=file3 Code (markup):
To redirect a bunch of old URL's to new one's, I would use this: Options +FollowSymlinks RewriteEngine on RewriteRule ^old_dir\/(.*)\.html$ http://www.example.com/newdir/search.php?item=$1 [L,R=301] Code (markup): Jean-Luc