Jump to content

Really easy RewriteCond Question!!


ridz4fun

What question?  

  1. 1. What question?

    • 1
      0
    • 2
      0


Recommended Posts

Hey Everyone!!

I’m really, really new to Apache and am hoping someone knows the answer to this one. Ok, I’ve got a domain, we’ll call it domain.com. I have a new domain, we’ll call it: newdomain.com. If a user types in the domain.com or www.domain.com it works fine, the problem is if a user has domain.com/pages/contact.html bookmarked, it takes them to an Error 404 page. How do I get rid of all the stuff past the / ?

 

RewriteEngine On

RewriteCond %{HTTP_HOST} domain.com [OR]

RewriteCond %{HTTP_HOST} www.domain.com

RewriteRule ^(.*)$ http://www.newdomain.com/new_dir$1 [R=301,L,QSA]

 

TIA!!!

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.