Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m pretty sure you can’t use htaccess for this, since htaccess file is just a simple text file read by IIS or appache.

    This is something you have to do programatically within PHP.

    Have a look at https://no2.php.net/header

    in .htaccess, you want a rewrite working for you. There are quite a few examples like this because it is a common need. I was just looking today because I need to redirect to better integrate woodpress into my stable site. I hesitate to try to put the code in here — having trouble trying to do a simple direct right now. And, similarly, I was looking for something of the same. Currently having trouble with php doing it – picking php because I don’t know where the site will go and don’t want to introduce extra side thing that need to work right.

    You have RewriteEngine On and usual put in the RewriteBase to lessen machine confusion, then for you, it is a simple RewriteCond .*/index.php?p=.*
    followed by RewriteRule with the R flag for redirect. Anyway, a look at the examples should give you the proper syntax. I don’t think you’d need more than those 3 or 4 lines ..

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘simple htaccess redirect question’ is closed to new replies.