slj90 Posted June 3, 2016 Share Posted June 3, 2016 (edited) Hello,Here is the structure of my website:website.com/events/page1?date=1224website.com/events/page2?date=0101website.com/events/page3?date=1105There are lots of different pages all of which I would like to use the $_Get 'date' on.I want to rewrite the URL using htaccess so that they can be loaded like this:website.com/events/page1/1224 website.com/events/page2/0101 website.comevents/page3/1105 Is this possible without having to create a separate rule for each page?Thanks in advance! Edited June 3, 2016 by slj90 Quote Link to comment https://forums.phpfreaks.com/topic/301290-rewrite-url-to-hide-get-in-htaccess/ Share on other sites More sharing options...
requinix Posted June 3, 2016 Share Posted June 3, 2016 (edited) Do you already have rewriting rules for /events/page1 and so on? Because those don't look like regular files. I sure hope they aren't. If so then you should modify those to use (or at least support) your desired /events/pageN/MMDD scheme. [edit] Whatever the answer, the first part of the RewriteRule will look something like RewriteRule ^/?events/page(\d+)/(\d\d\d\d)$which would allow for dates like 9876, but it's really not worth trying to handle that here (and not just because of the complexity). Edited June 3, 2016 by requinix Quote Link to comment https://forums.phpfreaks.com/topic/301290-rewrite-url-to-hide-get-in-htaccess/#findComment-1533386 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.