Dont understand navigation for the RewriteRule?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Jeyush
Forum Newbie
Posts: 3
Joined: Mon Jun 01, 2009 5:02 am

Dont understand navigation for the RewriteRule?

Post by Jeyush »

I dont proper understand how the RewriteRule will performing.

I have one file called

http://localhost/abc/company.htm?postCo ... btn=Submit

This is the page for I have to write my RewriteRule. So I write the code for that like this.

Code: Select all

Options +MultiViews
Options +FollowSymLinks
 
RewriteEngine On
 
RewriteRule company-postCodeArea-(.*)-btn-(.*)-(.*)\.htm$ abc/company.php?postCodeArea=$1&Search_btn=$2
But I dont get the proper result in the URL part when this page get load.

Can someone please tell me where I go wrong?

My understanding for the mod_rewrite is:

1)create file named .htaccess
2)write the rule.
3)Load the page

What are the must steps need to be done for the RewriteRule?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Dont understand navigation for the RewriteRule?

Post by requinix »

First, add an [R] flag to the rule (just like that, with the brackets, after the substitution string).

Now,
1. What URL are you going to?
2. What URL do you end up at?
Post Reply