• Resolved Jay

    (@the_circle_pit)


    Hello,

    I want do not want to show the /portfolio directory and anything in it on my site. I am not sure if I should use the Rewrite Rule or a redirect..

    This is what I have now, but it’s not working.

    RewriteRule /portfolio/$1 https://localhost/ [R=302,L]

Viewing 2 replies - 1 through 2 (of 2 total)
  • All this would do is redirect all content in the portfolio folder to a local install of WordPress. This isn’t a local install on your home computer/server is it?

    Thread Starter Jay

    (@the_circle_pit)

    Its local. I was testing it before putting on my live site.

    I ended up doing this…

    RedirectMatch 302 /portfolio/(.*) https://localhost.com/?s=$1
    Redirect 302 /portfolio https://localhost.com/

    Than change the 302 to 301 after testing.

    Also the ?s= from the first line is how my search works so it places any item that is typed after the /portfolio/ into a search for my site.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘htaccess Redirect or Rewrite Rule?’ is closed to new replies.