How to set permanent 301 redirect with htaccess?

Need php help with code to put in .htaccess for 301 redirect?

  • I'm new to php and could not figure out how to 301-redirect /index.php?main_page=index&cPath= to / and how to redirect /index.php?main_page=index to / Any experts on php? Thanks!

  • Answer:

    You can do a 301 redirect in this case because you would get stuck in an infinite loop, redirecting to the same file. 301 redirects are to send you to a different file altogether. You would want to use mod rewrite in this case. Google .htaccess mod_rewrite to find examples for your specific need.

KMJ at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.