FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


hi just want to ask something..





glena
hi... how does this work? instead of having a url: www.domain.com/view.php?uid=123123 it will look like this www.domain.com/123123... how can i make it like that???



thanks.. any ideas will help..
Diablosblizz
That would be using register_globals I believe.
Peterssidan
I don't think register_globals can be used for this. It's mod rewrite you should use.

The following code will do what you asking for (not tested)
Code:
RewriteEngine on

RewriteRule ^([0-9]+)$ view\.php\?uid=$1 [L]

Put the code in the .htaccess file at the domain root.
Diablosblizz
Ah sorry, I was thinking of something else. Yes, you are right mod_rewrite will work for this.
sonam
Peterssidan wrote:
I don't think register_globals can be used for this. It's mod rewrite you should use.

The following code will do what you asking for (not tested)
Code:
RewriteEngine on

RewriteRule ^([0-9]+)$ view\.php\?uid=$1 [L]

Put the code in the .htaccess file at the domain root.


If I have subdomain subdom.mydomain.com where I must put this htaccess in subdomain folder or in site root folder. I would like to use this option only in subdomain folder not in root folder. The second question is: Are any limitation of this because I was try htaccess on one other server but it is not working.

Sonam
rvec
RewriteEngine has to be allowed to be used in the apache config. If that's allowed you should be able to use it,
sonam
Quote:
RewriteEngine has to be allowed to be used in the apache config. If that's allowed you should be able to use it,


How I can see is it allowed or not?

Sonam
AOP Web Development
I think you can use it on subdomains to serve as root for as long as your hosting provider allow htaccess.
glena
that code wil do everything???


i saw php pages that looks like this www.domain.com/index/page/123

i want to format may url like that instead of normal url.. how can i do that and please explain.. i look over some forum i cant find answers.. please help..

and btw, is that safe to use?
glena
Peterssidan wrote:
I don't think register_globals can be used for this. It's mod rewrite you should use.

The following code will do what you asking for (not tested)
Code:
RewriteEngine on

RewriteRule ^([0-9]+)$ view\.php\?uid=$1 [L]

Put the code in the .htaccess file at the domain root.




can u explain the code part??
rvec
read through this if you want to be able to make more difficult urls possible:
http://corz.org/serv/tricks/htaccess2.php

It's not really hard, and that page really tells a lot about it.
glena
thanks...
Related topics
hi~ i m new~
Hi all
science vs. religion
Hi
A new comer just want to say hi
Why is it always the guys asking the girls?
hi i'm new
Hi my name is Gryx
Hi people
Hi all !!
hi i am deepak
Do I ask too many Questions
hi!
Hi ! from France
Hi everyone.
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.