# Problem on redirect, login page and SEO

**URL:** <https://forum.kirupa.com/t/problem-on-redirect-login-page-and-seo/304320>\
**Category:** programming\
**Created:** [February 5, 2010, 9:59am UTC](https://forum.kirupa.com/t/problem-on-redirect-login-page-and-seo/304320 "2010-02-05T09:59:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![annielhy](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@annielhy](https://forum.kirupa.com/u/annielhy)\
**Post date:** [February 5, 2010, 9:59am UTC](https://forum.kirupa.com/t/problem-on-redirect-login-page-and-seo/304320/1 "2010-02-05T09:59:27Z")

</div>

I have a SEO problem regards 301/302 redirection.

* * *

Here is the situation:

I have a domain, for example, [COLOR=Blue][http://mydomain.com](http://mydomain.com)[/COLOR]  
All my public content is placed at [COLOR=Blue][http://mydomain.com](http://mydomain.com)[/COLOR] **/myfolder/**  
Therefore, I have [COLOR=Blue][http://mydomain.com](http://mydomain.com)[/COLOR] **/index.php** to redirect to [COLOR=Blue][http://mydomain.com](http://mydomain.com)[/COLOR] **/myfolder/**

My site required all visitors to login.  
Hence, all pages in _ **myfolder** _ will redirect to [COLOR=Blue][http://mydomain.com](http://mydomain.com)[/COLOR]**/myfolder/[COLOR=DarkRed]login.php[/COLOR]**

I want the search engine to crawl the login page ONLY.  
I want the search engine to index it as [COLOR=Blue][http://mydomain.com](http://mydomain.com)[/COLOR]

* * *

To sum up, here is the redirection

[COLOR=Blue][http://mydomain.com](http://mydomain.com) [/COLOR]  
-\> [COLOR=Blue][http://mydomain.com](http://mydomain.com)[/COLOR] **/myfolder/** -\> (check if no login)  
-\> [COLOR=Blue][http://mydomain.com](http://mydomain.com)[/COLOR]**/myfolder/[COLOR=DarkRed]login.php[/COLOR]**

* * *

How should I wrote the redirect header?

Google seems alright with 302 redirections in both **/index.php** and **/myfolder/[COLOR=DarkRed][COLOR=SeaGreen]whateverpage.php[/COLOR][/COLOR]**[COLOR=DimGray] (include /myfolder/index.php)[/COLOR]. It index [COLOR=Blue][http://mydomain.com](http://mydomain.com)[/COLOR] with the content in [COLOR=Blue][http://mydomain.com](http://mydomain.com)[/COLOR]**/myfolder/[COLOR=DarkRed]login.php[/COLOR]**  
However, bing and yahoo cannot index my site.

Should I set everything as 301 redirections?

Thanks!
