SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mod_rewrite help

    I read through the examples in the mod_rewrite article but none of them seem to fit the two problems I seek to fix.

    My site has two effective root URLs with different suffixes. Users can get to the site using either root URL, but a Google search only turns up one of them. I want the other URL to be the default one in both Google and the browser.

    The other issue is that my Web host has my secure site on a different server than the main site, and I'm not able to add our default URL to the secure site's certificate. Can I use mod_rewrite on the secure server so that the user sees the same root URL for both servers? That sounds too much like a spammer's trick.

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Which one of these do you think would work for me?

    RewriteCond %{HTTP_HOST} !^www\.site\.net [NC]
    RewriteCond %{HTTP_HOST} !^$
    RewriteRule ^/(.*) http://www.site.com/$1 [L,R]

    RewriteCond %{HTTP_HOST} !^www\.site\.$ [NC]
    RewriteCond %{HTTP_HOST} !^$
    RewriteRule ^/(.*) http://www.site.com/$1 [L,R]

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2008
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please close this thread - I've started a new thread on this subject in the Apache Configuration area.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •