Adblock breaks this site

.htaccess and mod_rewrite

Discussion in 'Web Programming' started by marioiscool, Jan 15, 2013.

  1. marioiscool

    marioiscool Newcomer

    Joined:
    Jan 15, 2013
    Posts:
    1
    Referrals:
    0
    Sythe Gold:
    0
    .htaccess and mod_rewrite

    Hey,

    Before I begin, I'd like to say I realize there are tons of results on Google for this, and I can safely say I've read many of them, but I'm still not confident.

    I have a website, let's call it: mywebsite.com. I also have an SSL certificate installed and it works properly (it's for both www. and without www.).

    The first thing I'd like to do is remove www. from the URL (this part I'm pretty sound on). Simply redirect all www.mywebsite.com to mywebsite.com. My one question is regarding indexing and SEO. Will these rewrites cause any problems with crawlers or duplicate content?

    My second want is the one I'm a bit more iffy on: redirecting all HTTP requests to HTTPS. I only have the one domain (no subdomains), so I'm essentially going to be linking off of the main page to all HTTPS links, but want to have this in place in case someone tries to access a URL directly, it will redirect to HTTPS.

    Is it best to use HTTPS as a condition, or check the PORT the reuqest is coming in on? And is it possible to write this into one rewrite that both redirects http to https and www. to non www.? Or would I need to have two rewrites?

    http://www.mywebsite.com should be https://mywebsite.com, etc. If I had two rewrites, would it first remove the www. and then redirect to HTTPS?

    Any and all help/comments are appreciated.

    Thanks!

    EDIT: This would be on Apache as well.
     
< Runescape Username / Password ID HTML | >


 
 
Adblock breaks this site