Solved

Mod rewrite

Posted on 2009-05-13
4
189 Views
Last Modified: 2012-05-06
I'm trying to rewrite /newsletter/30/1.html so that it shows the page of /newsletter/30/1
/newsletter/30/2.html so that it shows the page of /newsletter/30/2
I tried this but had no luck.

RewriteEngine On
RewriteRule ^newsletter/([^/]*)/([^/]*)\.html$ /newsletter/$1/$2 [L]
0
Comment
Question by:paulp75
  • 2
  • 2
4 Comments
 
LVL 8

Expert Comment

by:thetmanvn
ID: 24372275
RewriteEngine On
RewriteRule ^(.*newsletter/)(.*)\.html$ $1$2/newsletter/$2\.html [L]

After this rule ....../newsletter/30/1.html will be rewritten to ...../newsletter/30/1/newsletter/30/1.html

Is that your expected
0
 
LVL 6

Author Comment

by:paulp75
ID: 24372491

the old script used to show it as /newsletter/30/1.html
but in the new script it shows as /newsletter/30/1
without the html

so i would like people who go to /newsletter/30/1.html to see /newsletter/30/1 instead
so that there are no 404 errors etc.
0
 
LVL 8

Accepted Solution

by:
thetmanvn earned 500 total points
ID: 24372580
So your rule will be:

RewriteEngine On
RewriteRule ^(.*newsletter/)(.*)\.html$ $1$2 [L]
0
 
LVL 6

Author Comment

by:paulp75
ID: 24373039
sorry i worked out that it was a routing issue with zend framework. thanks for your help though
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
CentOS 7 (Apache2) Cannot Install SSL Cert 1 61
PHP Error Settings 12 81
phpPgAdmin problem 14 141
Internal Server Error on 1&1 Apache Server running PERL 3 20
In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question