Rewrite URL in PHP with mod_rewrite?

You need to define a rewrite rule (should be similar to this): RewriteRule ^/(.*)/en/piecework/(.*)piecework_id=(0-9+)(.*) piecework.mydomainname. Com/en/$3 and put it in a . Htaccess file under the main folder of you site Full description of Rewrite rules here: httpd.apache.org/docs/2.0/misc/rewritegu... EDIT Made a mistake in my rule, hopefully I corrected it.

How about /en/piecework/piecework. Php? Soemthing=10&piecework_id=11&somethingelse=12 – Amarghosh Mar 17 '10 at 9:14 What does $3 or $2 mean?

– Steven Mar 17 '10 at 9:17 Thankyou for pointing out the mistake. @Steven $2 means the second group of the reg-ex that you got from parsing the string with this rule ie. : the second (.*) in fact what you need is (0-9+) which is the third group referenced by $3 – OverLex Mar 17 '10 at 9:18 I have specify the rules(RewriteRule ^/(.*)/en/piecework/(.*)piecework_id=(0-9+)(.*) piecework.mydomainname.Com/en/$3) in .

Htaccess(in my site root), but when I access piecework.mydomainname. Com/en/11, I got "Object not found". What's wrong?

– Steven Mar 18 '10 at 2:07 Have you enabled . Htaccess files in Apache configuration file? – OverLex Mar 18 '10 at 10:50.

I found a fairly well written crash course in doing so here: articles.sitepoint.com/article/guide-url... You'll need to specify the rules in . Htaccess (in your site root).

I have specify the rules(RewriteRule ^/(.*)/en/piecework/(.*)piecework_id=(0-9+)(.*) piecework.mydomainname. Com/en/$3) in . Htaccess(in my site root), but when I access piecework.mydomainname.Com/en/11, I got "Object not found".

– Steven Mar 18 '10 at 2:07.

I would suggest the following rule: RewriteCond %{HTTP_HOST} ^(?! Www)(^. +)\.

Mydomainname\. Com$ NC RewriteRule ^(w+)/(\d+)$ /$1/%1/%1. Php?

%1_id=$2 L.

I have specified the rules(RewriteCond %{HTTP_HOST} ^(?! Www)(^. +)\.

Mydomainname\. Com$ NC RewriteRule ^(w+)/(\d+)$ /$1/%1/%1. Php?

%1_id=$2 L ) in . Htaccess(in my site root), but when I access piecework.mydomainname. Com/en/11, I got "Object not found".

What's wrong? – Steven Mar 18 '10 at 2:08 Sorry, I've made a misprint. Try it like this: RewriteCond %{HTTP_HOST} ^(?!

Www)(^. +)\. Mydomainname\.

Com$ NC RewriteRule ^(\w+)/(\d+)$ /$1/%1/%1. Php? %1_id=$2 L – TonyCool Mar 18 '10 at 15:16.

Most of you will have read and/or heard about mod_rewrite — yes, it’s an Apache module, and it’s even installed by default! Go and check your modules directory (note that under *nix operating systems there’s a chance that your Apache was compiled with missing mod_rewrite, in which case, consult your sysadmin). We’re going use this tiny module to achieve everything mentioned above.

To use this module, first we have to enable it, since it’s initially disabled in the configuration file. Open the httpd. The first line tells Apache to load the mod_rewrite module, while the second one enables the use of it.

After you restart Apache, mod_rewrite should be enabled, but not yet running.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions