Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Help : mod_rewrite not working

Help me where I went wrong. 1st time I'm using mod_write

7:17 pm on Aug 17, 2012 (gmt 0)

New User

10+ Year Member

joined:May 17, 2007
posts: 17
votes: 0

Hi Greetings,

For the first time I'm trying to use mod_write kindly help me to resolve this issue.

RewriteEngine On
RewriteRule ^([^/]*)\.php$ /local.php?bangalore=$1 [L]

Thanks in Advance.

[edited by: incrediBILL at 2:39 am (utc) on Aug 18, 2012]
[edit reason] removed URLS, see TOS & Charter - paste all relevant data in post [/edit]

9:04 pm on Aug 17, 2012 (gmt 0)


WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
votes: 126

it's mod_rewrite...

what are you trying to do with mod_rewrite and how is your solution failing?
9:50 pm on Aug 17, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
votes: 598

Hm, shouldn't this be in Apache?

It looks as if he's trying to do the conventional rewrite from pretty URL to real home of content. It should be accompanied by a Redirect going in the opposite direction to grab users who ask for the long ugly URL in the first place.

The wording of the RewriteRule is a bit iffy because it would allow requests in the form


but I kinda doubt that's the problem.

Wander over to the Apache forum and look for the Redirect-to-Rewrite boilerplate. I repost it every couple of weeks. There's also one on query strings which may or may not be relevant. If you want the requested page name to become the new query string, and throw away any previous query string, you've got the right wording already.