MapFile not working
3 posts
• Page 1 of 1
MapFile not working
Hi,
We have a new website and we want to 301 redirect the old pages to a new one but the mapfile.txt is not working. Can you please help me with this issue ?
I looked ate the FAQ (Comprehensive map files insight) but nothing is working (or I don't understand it correctly...).
OLD PAGES:
http://www.site.com/page1.cfm
http://www.site.com/page2.cfm
...
Those will ALL point to : index.cfm
Here's the code I use :
.htaccess
RewriteEngine on
RewriteBase /
RewriteMap mymap txt:mapfile.txt
RewriteRule /([^/]+)\.cfm /{mymap:%1} [NC,R=301,L]
mapfile.txt
page1.cfm index.cfm
page2.cfm index.cfm
page3.cfm index.cfm
page4.cfm index.cfm
page5.cfm index.cfm
Thanks for your help!
Gilles
We have a new website and we want to 301 redirect the old pages to a new one but the mapfile.txt is not working. Can you please help me with this issue ?
I looked ate the FAQ (Comprehensive map files insight) but nothing is working (or I don't understand it correctly...).
OLD PAGES:
http://www.site.com/page1.cfm
http://www.site.com/page2.cfm
...
Those will ALL point to : index.cfm
Here's the code I use :
.htaccess
RewriteEngine on
RewriteBase /
RewriteMap mymap txt:mapfile.txt
RewriteRule /([^/]+)\.cfm /{mymap:%1} [NC,R=301,L]
mapfile.txt
page1.cfm index.cfm
page2.cfm index.cfm
page3.cfm index.cfm
page4.cfm index.cfm
page5.cfm index.cfm
Thanks for your help!
Gilles
Re: MapFile not working
Just found it !!!!
RewriteEngine on
RewriteBase /
RewriteMap mymap txt:mapfile.txt
RewriteMap mylower int:tolower
RewriteCond %{REQUEST_URI} ^/([^/]+)/?$
RewriteCond ${mymap:${mylower:%1}|NOT_FOUND} !NOT_FOUND
RewriteRule .? ${mymap:${mylower:%1}} [NC,R=301,L]
RewriteEngine on
RewriteBase /
RewriteMap mymap txt:mapfile.txt
RewriteMap mylower int:tolower
RewriteCond %{REQUEST_URI} ^/([^/]+)/?$
RewriteCond ${mymap:${mylower:%1}|NOT_FOUND} !NOT_FOUND
RewriteRule .? ${mymap:${mylower:%1}} [NC,R=301,L]
- tidaltides
- Posts: 24
- Joined: 27 Nov 2012, 21:57
Re: MapFile not working
It is great that you have shared it. Cheers!
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests