dckantor Posted August 12, 2008 Share Posted August 12, 2008 I have inherited a website which was redesigned a year ago. The site is in 3 languages. It used to have 3 separate html pages for each content page (e.g. index.en.html, index.es.html, index.zh.html). The site was rebuilt using lasso (not my choice) so now there is one page (index.lasso) which contains the 3 language content sections and depending upon what language the viewer is in only that part of the content is displayed. My Problem: I have thousands of hits on the pages that don't exist anymore (becuase people bookmarked them) and no efficient way to redirect them. My Question: Is there a way to create a bit of code that would for example: take any of three forms of the url ..../index.**.html and replace it with the url ..../index.lasso I would need to do it may times for many pages so even better would be code to redirect www.mysite.com/pagename.**.html www.mysite.com/pagename.lasso Thanks very much for any ideas. dckantor Quote Link to comment https://forums.phpfreaks.com/topic/119310-redirect-groups-of-pages/ Share on other sites More sharing options...
DarkWater Posted August 12, 2008 Share Posted August 12, 2008 Why is this in the OOP board? Anyway, this is just mod_rewrite. RewriteEngine On RewriteRule ([a-zA-Z0-9\-_]+).([a-zA-Z]{2}).html $1.lasso Quote Link to comment https://forums.phpfreaks.com/topic/119310-redirect-groups-of-pages/#findComment-614584 Share on other sites More sharing options...
dckantor Posted August 13, 2008 Author Share Posted August 13, 2008 Thanks - that's just what I need. Unfortunately being a lasso newbie I don't know where that code is supposed to go. Do I put it in my default.lasso page (this is currently the page that shows on error)? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/119310-redirect-groups-of-pages/#findComment-615647 Share on other sites More sharing options...
Daniel0 Posted August 13, 2008 Share Posted August 13, 2008 In httpd.conf or .htaccess Quote Link to comment https://forums.phpfreaks.com/topic/119310-redirect-groups-of-pages/#findComment-615648 Share on other sites More sharing options...
dckantor Posted August 13, 2008 Author Share Posted August 13, 2008 Thanks - if I can't find either of these files should I create a .htaccess file in the root dir of the site. This is a site running on a Mac Desktop machine and the dirs don't contain a .htaccess or a config file that I can find. Thanks for the help Quote Link to comment https://forums.phpfreaks.com/topic/119310-redirect-groups-of-pages/#findComment-615665 Share on other sites More sharing options...
Daniel0 Posted August 13, 2008 Share Posted August 13, 2008 You'll have to create the .htaccess in the directory you want things to apply in. Quote Link to comment https://forums.phpfreaks.com/topic/119310-redirect-groups-of-pages/#findComment-615700 Share on other sites More sharing options...
dckantor Posted August 14, 2008 Author Share Posted August 14, 2008 I have created the .htaccess file, placed it in the appropriate dir and confirmed that there are no .htaccess or config files that override it. But my pages are not being redirected. Any other thoughts? THanks Quote Link to comment https://forums.phpfreaks.com/topic/119310-redirect-groups-of-pages/#findComment-616531 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.