473,289 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

i want to htaccess code with argument vlaue passing using php

I have used htaccess file for static page. for example
I have used the url for about us page

But how can i do the htaccess for argument.
could u please give me explanation for htaccess and codes how can i do it.

i want this format http://www.example.com/example instead of the following format http://www.example.com/example.php?pageid=20

Please help to me.
Mar 7 '08 #1
1 1421
dlite922
1,584 Expert 1GB
I have used htaccess file for static page. for example
I have used the url for about us page

But how can i do the htaccess for argument.
could u please give me explanation for htaccess and codes how can i do it.

i want this format http://www.example.com/example instead of the following format http://www.example.com/example.php?pageid=20

Please help to me.
first you need to have this at the root of your site in a htaccess file:

[color=#000000]RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|css)$ index.php

replace index.php with your default page as necessary.

That code forwards all non-resource URL to your home page.

Then you need to PARSE the URL. I won't go into it here but
there are lots of resources for you that can guide you through it.

What you're wanting is called human-friendly URLS

so this:

[/color]http://www.example.com/example.php?pageid=20

can be replaces with this:

http://www.example.com/pageid/20


Zend Framework does this:

http://framework.zend.com/manual/en/zend.controller.html#zend.controller.quickstart
Mar 7 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Alex Vinokur | last post by:
Various forms of argument passing ================================= C/C++ Performance Tests ======================= Using C/C++ Program Perfometer...
15
by: Taki Jeden | last post by:
Hello everybody Does anybody know why w3c validator can not get pages that use 404 htaccess redirection? I set up two web sites so that clients request non-existent urls, but htaccess redirects...
3
by: Vardan Kushnir | last post by:
Please forgive me if my English is poor. Also please tell me if this is wrong place to ask this question and tell me better place. When searching web for information Re: .htaccess and...
8
by: inkexit | last post by:
I am a very amatuer c++ programmer and a somewhat accomplished composer. I am trying to write some code that creates 'self similar' melodies from a base melody the user inputs. This musical idea...
16
by: G Patel | last post by:
Hi, If I want to call functions that don't return int without declaring them, will there be any harm? I only want to assign the function(return value) to the type that it returns, so I don't...
31
by: DeltaOne | last post by:
#include<stdio.h> typedef struct test{ int i; int j; }test; main(){ test var; var.i=10; var.j=20;
40
by: Neo The One | last post by:
I think C# is forcing us to write more code by enforcing a rule that can be summarized as 'A local variable must be assgined *explicitly* before reading its value.' If you are interested in what...
1
by: Alessandro Fachin | last post by:
I write this simply code that should give me the access to private page with htaccess using a proxy, i don't known because it's wrong... import urllib,urllib2 #input url...
13
by: Fro | last post by:
Hi, my site allows to upload images. For that reasons I have created a directory which have "drwxrwxrwx"-permission. I.e. everybody can write in that directory. I understand that it is not save,...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.