wal_toor
asked on
htaccess redirect
Hello all,
Is it possible to create a redirect rule when an url does not contain anything after the domain extension? Because I have a local, production and live version the domain extension should be treated as variable.
mydomain.nl -- redirect to --> mydomain.nl/nl
mydomain.nl/ -- redirect to --> mydomain.nl/nl
mydomain.local -- redirect to --> mydomain.local/nl
mydomail.nl/fr -- no redirect
mydomail.local/fr/whatever /comes/nex t -- no redirect
Can this be done?
Thankz!
Greetz,
walter
Is it possible to create a redirect rule when an url does not contain anything after the domain extension? Because I have a local, production and live version the domain extension should be treated as variable.
mydomain.nl -- redirect to --> mydomain.nl/nl
mydomain.nl/ -- redirect to --> mydomain.nl/nl
mydomain.local -- redirect to --> mydomain.local/nl
mydomail.nl/fr -- no redirect
mydomail.local/fr/whatever
Can this be done?
Thankz!
Greetz,
walter
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Spot on!
Open in new window
This will match both domains you have listed above; however, I'm sure you'll have to modify it to your needs.I'm not sure what the exact syntax of the rule should look like, but I do know that .htaccess supports regexes.