Rewrite rules not working on localhost

Manish Goyal

Manish Goyal

@manish-r2Hoep Oct 21, 2024
Hello Friends

I am badly stuck with following Problem

I have a Project set up on my localhost in following hierarchy

www/htdocs/abl

Now the Problem is I want to rewrite following url :

#-Link-Snipped-#

to

#-Link-Snipped-#

For this I have written a .htaccess file with following code

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^([^/]+)/category/([^/]+).html /index.php?file=$1&sub1=category [NC]
But it is not working, what I am doing wrong here?

Thanks in advance

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • KenJackson

    KenJackson

    @kenjackson-mBf7HF Oct 20, 2013

    The order of the URLs on the RewriteRule line is backwards. It should be old then new.

    Also, the abl directory is missing from both.
  • Manish Goyal

    Manish Goyal

    @manish-r2Hoep Oct 25, 2013

    thank you ken for reply

    I had managed to make it work

    There was no need to define directory , if you are working on same directory in which files resides