Help with .htaccess - redirect only one kind of URLs

Discussion in 'Apache' started by postcd, Jan 28, 2014.

  1. #1
    Hello,

    this redirect redirects all subpages of a domain to another domain while not redirecting to index.php but to same page, only at another domain:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !^cz\.hq-scenes\.com$ [NC]
    RewriteRule ^(.*)$ http://cz.hq-scenes.com/$1 [R=301,L]

    i want to achieve that only pages like /viewtopic.php...............

    will be redirected (............. means any other characters)

    Please how to redirect all viewtopic.php pages only? How to modiffy it?
     
    postcd, Jan 28, 2014 IP
  2. rapaman

    rapaman Active Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #2
    write example how you want redirect - source url to target url and I will write you example
     
    rapaman, Jan 28, 2014 IP
  3. rapaman

    rapaman Active Member

    Messages:
    42
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #3
    For start point
    RewriteRule ^/?viewtopic.php http://domain_com [R=301,L]
    Code (markup):
     
    rapaman, Jan 28, 2014 IP