Forum Moderators: phranque

Message Too Old, No Replies

Problem redirecting internal pages but not index page . help me

         

papa_mia

5:33 am on Nov 21, 2010 (gmt 0)



Hello

I have a site at:

example.com

I want to move it to a subfolder, so that

example.com

will open:

example.com/old


Some of the pages include ( index.php?catid=.. )

I want them also to redirect to:

( old/index.php?catid=.. )

So I used this line in the .htaccess file:

redirect 301 /index.php http://www.example.com/old/


But I want to install a new site to be open when you click:

http://www.example.com

I don't want http://www.example.com to redirect to http://www.example.com/old

I just want to redirect pages that include ( index.php?catid=.. )
to ( old/index.php?catid=.. )

And by using the redirect rule above I am getting users redircted from my new site to the old site, which is not wat I want. I just don't want to lose visits through google to internal pages that include (index.php) in the urls.

So I renamed the index file of my NEW site from index.php to default.php

and I used this line in htaccess :

DirectoryIndex default.php

Which is working.

But when I did that, example.com/old will not open the old site, it will open an "index of" page with the list of files and folders in the old site.

I am not very good at English, and I don't know if i've made the issue clear, and described the problem will.

Please help me on the right way to make the redirections without redirecting example.com to the old site.

Thank you

papa_mia

9:35 pm on Nov 22, 2010 (gmt 0)



bump

The problem is not complicated, but maybe I made it sound so by over-explanation :)

I'm sure any expert on the subject will know the solution. And If you see the problem needs rephrasing please tell me.

I need the answer badly

jdMorgan

9:26 pm on Nov 30, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The problem is not that the solution is complex, it is that you have not posted any effort to fix the problem yourself. We have too few volunteers here to offer a "free code-writing service for the world." Therefore, our focus is on helping you write your own code, not on providing ready-made code solutions.

Something like this should get you started. See the documentation cited in our Apache Forum Charter and the examples in our Apache Forum Library.

Options +FollowSymLinks -MultiViews
RewriteEngine on
#
RewriteCond %{QUERY_STRING} ^catid=.
RewriteRule ^index\.php$ http://www.example.com/old/index.php [R=301,L]

This may not be exactly what you want or need. However, you will be responsible to test it and get it working by asking very-specific questions here, based on your review of the materials cited above.

Jim