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
https://forums.phpfreaks.com/topic/104599-really-easy-rewritecond-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.