Does not show same result after .htaccess url rewrite

I needed to redirect www.ehomzdotca/#address_city=Markham&address_streetaddress=&transactiontype=For+lease type of urls to www.ehomz.ca/Markham-Real-Estate type of urls.

So I added rewrite conditions to my .htaccess. But after inserting the redirect code it does not show same result in those pages. I’m not clear why it’s not working properly. Appreciate your help.

Following is it:

#Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTP_HOST} ^http://local-ehomz.com/ [NC]
RewriteRule ^(sitemap)/$ ./sitemap [L]
RewriteRule ^(sitemap)$ ./sitemap.php [L]

RewriteRule ^(.*)(-Real-Estate)/(.*)/(.*) ./#address_city=$1&address_streetaddress=$3&transactiontype=$4 [L]
RewriteRule ^(.*)(-Real-Estate)/(.*) #address_city=$1&address_streetaddress=&transactiontype=$3 [L]
RewriteRule ^(.*)(-Real-Estate) #address_city=$1&address_streetaddress=&transactiontype=For+lease [L]
RewriteRule ^(.*)(-Real-Estate) #address_city=$1&address_streetaddress=&transactiontype=For+sale [L]

RewriteRule ^.+?/((i|images)/.+)$ /$1 [L,R=301,NC]

RewriteRule ^(sitemap)/([A-Za-z0-9-_.*+,()]+)$ ./sitemap.php?municipality=$2 [L]

RewriteRule ^(sitemap)/([A-Za-z0-9-_.*+,()]+)/([A-Za-z0-9-_.*+,()]+)$ ./sitemap.php?municipality=$2&community=$3 [L]
RewriteRule ^(sitemap)/([A-Za-z0-9-_.*+,()]+)/([A-Za-z0-9-_.*+,()]+)/([A-Za-z0-9-_.*+,()]+)$ ./sitemap.php?municipality=$2&community=$3&street=$4 [L]

RewriteRule ^([A-Za-z0-9-_.*+,()]+)(-homes-for-sale)/([A-Za-z0-9-_.*+,()]+)([/A-Za-z0-9-_.*+,()]*)$ ./detail_page.php?municipality=$1&address=$3 [L]
RewriteRule ^([A-Za-z0-9-_.*+,()]+)(-homes-for-lease)/([A-Za-z0-9-_.*+,()]+)([/A-Za-z0-9-_.*+,()]*)$ ./detail_page.php?municipality=$1&address=$3 [L]
RewriteRule ^([A-Za-z0-9-_.*+,()]+)(-homes-for-sub-lease)/([A-Za-z0-9-_.*+,()]+)([/A-Za-z0-9-_.*+,()]*)$ ./detail_page.php?municipality=$1&address=$3 [L]


#DirectoryIndex search_new.php
Options -Indexes

<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>


Source: .htaccess

Leave a Reply