Jump to content

Removing "?it=index.html" from .htaccess redirects?

Lance O.

Recommended Posts

I know this question has been asked before, but in this case, I don't want to use a PW module.

I have added redirects at the very top of my .htaccess file, formatted like the examples below:

RedirectMatch 301 /onsite2/ http://domain.com/
Redirect 301 /onsitefocusedthanks/ http://domain.com/club/

Unfortunately, the redirects are going to:

http://www.domain.com/onsite/ (404 page not found)

Is there a way to removed the "?it=index.html" and prevent these redirect errors?

Link to comment
Share on other sites

Since you're using Redirect / RedirectMatch, both of which are features of mod_alias, there's no way that I'm aware of to do this.

What you should do is move this redirect after the "RewriteEngine On" part of the .htaccess file and use a RewriteRule (mod_rewrite):

RewriteRule ^onsite2/$ http://domain.com/ [R=301,L]
RewriteRule ^onsitefocusedthanks/$ http://domain.com/club/ [R=301,L]


  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...