Only one rule works in Mod_Rewrite

Hello this is my htaccess

<IfModule mod_rewrite.c>
RewriteEngine on

RewriteRule webbdesign/(.*)/(.*)/(.*)/(.*)\.html /pages.php?sid=$1&mpg=$2&mn=$3&sn=$4
RewriteRule (.*)/(.*)\.html /pages.php?mid=$1&mn=$2

RewriteRule webbdesign /index.php


But only this rule works

RewriteRule (.*)/(.*)\.html /pages.php?mid=$1&mn=$2

y? :(
Who is Participating?
hernst42Connect With a Mentor Commented:
Add the L option ( and try this:
RewriteEngine on
RewriteRule webbdesign/(.*)/(.*)/(.*)/(.*)\.html /pages.php?sid=$1&mpg=$2&mn=$3&sn=$4 [L]
RewriteRule (.*)/(.*)\.html /pages.php?mid=$1&mn=$2 [L]
RewriteRule webbdesign /index.php [L]

Open in new window

sahanlakAuthor Commented:
It works, thanks a lot. Have few questions. I believe that [L] is limiting ? how does that help?

And other one I'm using relative links so this is the prob.

Before mod rewrite this was my page

when the page views with modrewrited URL,  my other links in the bage starts with ""  how to stop that
Where in your HTML code you have
<a href="pagename.html">Pagename</a>
That you expect to link to, simply put a "/" slash before the url, to make tha path absolute, instead of relative to the current URL
<a href="/pagename.html">Pagename</a>
will always point to
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

nope [L] is last, stop rewriting here and do no further rewriting.
sahanlakAuthor Commented:

When I add this rewrite rule FCK editor @ my back-end not working. Whats the prob ?
sahanlakAuthor Commented:
Works perfect, thanks
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.