How to rewrite this rule with .htaccess ?

Posted on 2009-04-24
Last Modified: 2012-05-06
I want rewrite this rule: >

How to do this?

Question by:laptop1vn
    LVL 27

    Expert Comment

    > a_String

    Is that your pattern, i.e. character, underscore, characters?
    RewriteEngine on
    RewriteRule ^([a-z]_[a-z]+)$ /login.php?username=$1 [L]

    Open in new window


    Author Comment

    Seem not success?

    I tried:

    Not Found

    The requested URL /something was not found on this server.


    I already have other rewrite, it run OK

    My htaccess:

    RewriteEngine on
    RewriteBase /
    RewriteRule ^([a-z]_[a-z]+)$ /login.html?user=$1 [L]
    RewriteRule ^fi/(.*)$ /fi.html?s=$1 [L]

    LVL 27

    Accepted Solution

    Well, if your don't have a pattern like /f_bar as described above but /foo, the regEx can't match.
    RewriteEngine on
    RewriteBase /
    RewriteRule ^([a-z]+)$ /login.html?user=$1 [L]
    RewriteRule ^fi/(.*)$ /fi.html?s=$1 [L]

    Open in new window


    Author Closing Comment

    It's OK!
    Thank caterham_www much :)

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Join & Write a Comment

    As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
    Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    734 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

    22 Experts available now in Live!

    Get 1:1 Help Now