Forum Moderators: phranque
a simple redirection in .htaccess is syntaxed like this:
RedirectPermanent /domain1/domain11/index.htm [domain.com...]
BUT what if I have numerous domains and for a specific set of links I need to redirect users?
i.e.
RedirectPermanent /domain1/domain11/hotel/index.htm [domain.com...]
domain1 and domain11 are not static but dynamic...I need a rule to work for domain1, 2, 3, 4, 5 and domain11,2,33,44
something like this
RedirectPermanent /*/*/hotel/index.htm [domain.com...]
Any Ideas?
thx in advanceeeee
Jim
RedirectMatch /(.*)-hotel.htm$ /$1-hotels-alpha-.htm
the second part (link/page) "/$1-hotels-alpha-.htm" is also created by a previous rule in order to transform from php to htm and the problem is that intead of getting this url (once redirected):
/ios-hotels-alpha-.htm
i get this:
/ios-hotels-alpha-.htm?area_name=cyclades&island_name=ios&island_name=ios&type_name=hotel
which includes the php variables
my transformation rule is:
RewriteRule ^(.*)/(.*)/hotels/(.*)-(.*)-alpha-(.*).htm$ list_alphabetical.php?area_name=$1&island_name=$2&island_name=$3&type_name=$4&alph=$5 [nc]
and works fine...
ANY IDEAS?
thx in advance...
RewriteRule ^([^-]+)-hotel\.htm$ /$1-hotels-alpha-.htm?
RewriteRule ^([^/]+)/([^/]+)/hotels/([^-]+)-([^-]+)-alpha-([^.]+)\.htm$ list_alphabetical.php?area_name=$1&island_name=$2&island_name=$3&type_name=$4&alph=$5 [NC]
Jim
I have created this by combining ur thoughts:
RewriteRule ^(.*)-hotel(.*).htm$ $1-hotels-alpha-$2.htm?
RewriteRule ^(.*)/(.*)/hotels/(.*)-(.*)-alpha-(.*).htm$ list_alphabetical.php?area_name=$1&island_name=$2&island_name=$3&type_name=$4&alph=$5 [nc]
which is working fine...for instance...
the url "cyclades/ios/hotels/ios-hotel.htm" calls succesfully the "cyclades/ios/hotels/ios-hotels-alpha-.htm"...
But...
I when using the additional string to display the hotels by names...(scripts are running...ulz are still a problem)...for instance:
the url "cyclades/ios/hotels/ios-hotelA.htm" which should call "cyclades/ios/hotels/ios-hotels-alpha-A.htm"
calls the "cyclades/ios/hotels/ios-hotels-alpha-.htm" which is actually the first page...The A,B,C...etc do not pass to the "&alph=$5 " and the script is not working correctly...
This is the last bit.....I would like to call:
"cyclades/ios/hotels/ios-hotelA.htm"
"cyclades/ios/hotels/ios-hotelB.htm"
"cyclades/ios/hotels/ios-hotelC.htm" etc. and get the
"cyclades/ios/hotels/ios-hotels-alpha-A.htm"
"cyclades/ios/hotels/ios-hotels-alpha-B.htm"
"cyclades/ios/hotels/ios-hotels-alpha-C.htm"
I tried this in my rule above
RewriteRule ^(.*)-hotel(.*).htm$ $1-hotels-alpha-$2.htm?
RewriteRule ^(.*)/(.*)/hotels/(.*)-(.*)-alpha-(.*).htm$ list_alphabetical.php?area_name=$1&island_name=$2&island_name=$3&type_name=$4&alph=$5 [nc]
but it is not working......
I need ur wisdom...
Thx for everything again..
omoutop