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

x
?
Solved

Rewrite URLs in htaccess file

Posted on 2010-08-30
5
Medium Priority
?
263 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
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

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