Hi,

I made a web application and I am passing variables like this

www.mysitename.com/index.php?variableName=120

but I found in some web sites that the url like this

www.mysitename.com/120

I don't have any idea about this. Can any one tell me how can I do this in my website also

Thanks in advance
Rajeesh

Recommended Answers

All 6 Replies

In this format it would normally be trying to execute the index module in the folder called 120. I don't believe that this has anything to do with passing variables.

its because of htaccess, try searching about htaccess so you know what it can do about rewriting urls

Yeah VaultDeweller is Right..... Its same as he said......

Hey,
If my understandings are correct,you want to change your url pattern to something like the one you mentioned.rit? So in the Hyperlink (where ever you need) specify the url as

www.mysitename.com/variableName/120/index.php

Then in .htaccess use the rewrite rule as

RewriteRule ^variableName/([^\.]+)/([^\.]+)\.php$ www.mysitename.com/index.php?variableName=$2 [L]

Was not sure really may be some bugs be ter. Just find it out okey!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.