Jump to content

multiple parameters in querystring - help!


wrathican

Recommended Posts

Hi people,

 

Thanks for looking.

 

Im making a site and it consists of a blog.

 

what i have managed to do is convert this:

http://localhost/newBlog/index.php?page=blog&blog=1234

 

into:

http://localhost/newBlog/blog/1234

 

but my site also has other pages, like contact, home, about etc...

so i'll have urls like:

http://localhost/newBlog/index.php?page=contact

 

turned into:

http://localhost/newBlog/contact

 

the problem is if any of the parameters are missing (like the blog to be viewed) i get a server error.

 

how would i rewrite so that i can have two different types of urls?

 

eg main links:

http://localhost/newBlog/index

http://localhost/newBlog/about

http://localhost/newBlog/blog

http://localhost/newBlog/gallery

 

and sub links:

http://localhost/newBlog/blog/456

http://localhost/newBlog/gallery/123

 

i guess i would need conditionals but im really not rewrite savvy yet.

 

If you could point me to how this could be done/give me some tips

 

i would be very greatful

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/133232-multiple-parameters-in-querystring-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.