Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Mod rewrite

Posted on 2009-05-13
4
Medium Priority
?
196 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month11 days, 12 hours left to enroll

636 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