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

Posted on 2009-02-08
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
Question by:s1m0n123
    LVL 27

    Accepted Solution

    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]

    Author Closing Comment

    Worked like a charm, thanks

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System ( introduces the Login System and shows how to implement a login page. The EE Collaborative Logiā€¦
    Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
    Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
    The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now