?
Solved

Rewrite URLs in htaccess file

Posted on 2010-08-30
5
Medium Priority
?
262 Views
Last Modified: 2012-05-10
Hello Experts,
My htaccess file looks like this. currently i am rewriting my urls from

mysite.com/store/merchant.mvc?Screen=PROD&Product_Code=easter_egg_hunt&Category_Code=Easter

to mysite.com/store/easter_egg_hunt-p-easter.html

here is the code i am using my htaccess file

RewriteRule ^store/([A-Za-z0-9_-]+)-p-([^.]+)\.html$ /store/merchant.mvc?Screen=PROD&Product_Code=$1&Category_Code=$2


I want to change this to display like this
mysite.com/store/easter_egg_hunt/easter.html

how can i rewrite my htaccess file to achieve this.

Thanks and appreciate it
0
Comment
Question by:niceoneishere
[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
5 Comments
 
LVL 10

Accepted Solution

by:
Chad Smith earned 2000 total points
ID: 33562985
RewriteRule ^store/([A-Za-z0-9_-]+)/([^.]+)\.html$ /store/merchant.mvc?Screen=PROD&Product_Code=$1&Category_Code=$2
0
 
LVL 13

Expert Comment

by:marchent
ID: 33563173
RewriteRule ^store/([A-Za-z0-9_-]+)-p-([^.]+)\.html$ /store/$1/$2.html
0
 
LVL 13

Expert Comment

by:marchent
ID: 33563190
sorry... got wrong... i thought its regex...
0
 
LVL 26

Expert Comment

by:arober11
ID: 33578238
Or:

RewriteRule ^store/([^/]+)/([^.]+)\.html$      /store/merchant.mvc?Screen=PROD&Product_Code=$1&Category_Code=$2 [L]
0
 
LVL 1

Author Closing Comment

by:niceoneishere
ID: 33720168
Thanks
0

Featured Post

DFW AZURE MEETUP TONIGHT FRI 6PM

We will be discussing what Azure Stack is, how does it fit into the suit of offerings that Azure has currently, and where can it fit into your organizations technology stack. We will also be discussing limitations of the platform while covering various applicable scenarios.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmakerā€¦
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

752 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