Jump to content

[SOLVED] Mod Rewrite


jaymc

Recommended Posts

I use a lot of Mod ReWrite to produce nice URL's, see the example below

 

RewriteRule  ^hub/(.+)/(.+)/(.+)?$ ?open=hub&page=$1&catID=$2 [L]

 

However, I want users to be taken to ?open=hub&page=&catID= if anything after hub/ is not defined

 

Here is the full url

 

www.site.com/hub/view_topics/123/topic.html # This works with the above mod rewrite

www.site.com/hub # This does not work, it just loads a 404

 

 

When going to  www.site.com/hub I would rather it produce this ?open=hub&page=&catID=

 

How can this be done?

Link to comment
https://forums.phpfreaks.com/topic/108509-solved-mod-rewrite/
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.