943,822 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 539
  • PHP RSS
Sep 3rd, 2009
0

Changing Url Output

Expand Post »
I have pages written in html that use javascript and css, what I would like to do is use php to change how the url comes out.

So I would like the url to look like mywebsite.com/index.php?xx1122 or something like that without disclosing the location of the html files or the type of files they are.

I have been working on this for 3 days and still cant find an answer to this. Im hoping someone can help me with this.

Please keep in mind that I am a php newbie. Thank you all.
Similar Threads
Reputation Points: 10
Solved Threads: 2
Junior Poster
valonesal is offline Offline
120 posts
since Aug 2009
Sep 3rd, 2009
0

Re: Changing Url Output

You would have to use a .htaccess file to do that.
.htaccess files are straightforward once you are used to them, but can be a little tricky to begin with.

Please could you post an example of the current url and what you would like the replacement url to be?
That way, maybe someone can give you an example syntax for the .htaccess file.


Please note, if you're not sure what you are doing with the .htaccess, you could potentially break other urls on your website.
Reputation Points: 14
Solved Threads: 10
Junior Poster in Training
SimonMayer is offline Offline
53 posts
since Apr 2008
Sep 3rd, 2009
0

Re: Changing Url Output

Currently the url is pretty straight forward http://mywebsite.com/folder/folder/folder/file.html

I would like it to be something without so many folders and to not end in html. but something that doesn't let them know where the file is such as http://mydomain.com/get.php?12345
Reputation Points: 10
Solved Threads: 2
Junior Poster
valonesal is offline Offline
120 posts
since Aug 2009
Sep 3rd, 2009
0

Re: Changing Url Output

Reputation Points: 232
Solved Threads: 137
Practically a Master Poster
buddylee17 is offline Offline
665 posts
since Nov 2007
Sep 3rd, 2009
0

Re: Changing Url Output

This has more to do with your web server than PHP. If you are using an Apache web server, do some research on "mod_rewrite".

Edit: As I see buddylee17 has already recommended =)
Last edited by EvolutionFallen; Sep 3rd, 2009 at 7:14 pm.
Reputation Points: 40
Solved Threads: 31
Junior Poster
EvolutionFallen is offline Offline
198 posts
since Aug 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Blank php pages that have mysql connections
Next Thread in PHP Forum Timeline: PHP Positioning help please





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC