0

How do I redirect a URL in PHP? If I use .htaccess to redirect, then it's asking me for authentication (username & password). I want to redirect to a URL without any authentication. Is it possible in PHP? I don't want to use headers or meta tags or window.location to redirect. Is there any other way is possible?

2
  • 1
    This is not making much sense yet. Can you describe in detail what exactly you want to do? And what kind of authentication comes in at what point? Commented Aug 4, 2010 at 14:26
  • 2
    PHP and Htaccess are different. It is not possible to answer this question as it stands. Pick either PHP and use header() or htaccess and Redirect example.com example.com/page [R=301] Commented Aug 4, 2010 at 14:30

1 Answer 1

1

My guess is that you perhaps copy/pasted some code into your .htaccess file has basic authentication?

You only need one line to do that in .htaccess

Redirect 301 /oldpath http://sitecom/newpath
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.