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
Solved

Rewrite URLs in htaccess file

Posted on 2010-08-30
5
257 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
5 Comments
 
LVL 10

Accepted Solution

by:
Chad Smith earned 500 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

808 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