[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

.htacess/mod rewrite to replace a string with a "/"

Posted on 2009-02-08
2
Medium Priority
?
303 Views
Last Modified: 2012-05-06
I need a RewriteRule for htaccess that replaces "prnt" (without the quotations) to a forward slash "/" (without the quotations).

I've been trying to do this for about a day and keep failing! Can anyone offer any help at all? Thanks
0
Comment
Question by:s1m0n123
2 Comments
 
LVL 27

Accepted Solution

by:
caterham_www earned 2000 total points
ID: 23584896
That will replace an URL-path with a slash for an internal rewrite, but may be you have a more specific pattern?

RewriteEngine on
RewriteRule ^(.*)prnt(.*) $1/$2 [L]

To force a redirect, you'll need the R flag

RewriteEngine on
RewriteRule ^(.*)prnt(.*) $1/$2 [R=301,L]
0
 

Author Closing Comment

by:s1m0n123
ID: 31544289
Worked like a charm, thanks
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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
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…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

834 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