Solved

Mod rewrite

Posted on 2009-05-13
4
185 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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 …
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now