• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

.htaccess Regional URL Re-Writes


Senior Member
OK need an htaccess expert to help with a url rewrite.

Need to so that the first section of a url is taken if listed in htaccess file and then adds a url info at end.

For example


Would rewrite to



Would rewrite to


So that i can have one site being mirrored for several regions without having to take a copy of the site for all regions.


Active Member
I think that sounds like you want a 301 redirect? if you google it you might get what your looking for...

Failing that Jaz on here would be your man, if he doesn't pop along and googles no help send him a pm...


Senior Member
RewriteEngine on

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !.cfm
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://localhost:8888/$1/ [L,R=301]

RewriteRule uk/powerkites(.*)/$ website/$1/?regionid=uk&sportid=powerkites
RewriteRule uk/powerkites(.*).cfm$ website/$1.cfm?regionid=uk&sportid=powerkites

The first part forces a trailing forward slash.