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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.