Solved

Mod rewrite

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

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…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

749 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