X10nD
X10nD

Reputation: 22040

URL rewrite for DomainName.com

I am doing a rewrite for url www.DomainName.com/x. If any user types in

  1. DomainName.com/x or
  2. DomainName.com/x/

it must go to exit.php, where "x" can be anything.

My Code is

RewriteEngine on
RewriteRule /$ exit.php
RwriteRule $ exit.php

How do I write the rewrite code for it to go to exit.php and when DomainName.com is typed it should go to DomainName.com not exit.php

Thanks Jean

Upvotes: 0

Views: 347

Answers (1)

lszrh
lszrh

Reputation: 1582

RewriteEngine on
RewriteRule ^(|start\.php)$ start.php [L] #Contains the filename you want to redirect when calling www.domain.tld/
RewriteRule .+ exit.php [L]

Upvotes: 2

Related Questions