So, here _was_ my .htaccess:
And I am trying to add some URL rewriting to the mix because I have had the feature programmed into my CMS for a while now, but not implemented it.
Issue 1:
All pages are accessed via /index.php. Currently, they also have ?id=\d{1,3}. I would like any page accessed with ?id= to be replaced with the semantic URL set in the database. I intend to use a rewrite map to do this, having the map updated each time a page's semantic URL is changed.
Issue 2:
I need all pages that are accessed semantically, like /a_page to be re-written to /index.php?url=a_page.
I am decent but not stellar with regular expressions, and pretty early along my journey to master the rewrite module.
I have been trying several things and I got it close for issue two once and have not moved on to issue one. If anyone has any input for me, I would appreciate it. I'll be working on this until I get it figured out, so I will post any progress that I make.
Thanks!
Code:
RewriteEngine On # Remove www. RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] # Send to SSL RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
Issue 1:
All pages are accessed via /index.php. Currently, they also have ?id=\d{1,3}. I would like any page accessed with ?id= to be replaced with the semantic URL set in the database. I intend to use a rewrite map to do this, having the map updated each time a page's semantic URL is changed.
Issue 2:
I need all pages that are accessed semantically, like /a_page to be re-written to /index.php?url=a_page.
I am decent but not stellar with regular expressions, and pretty early along my journey to master the rewrite module.
I have been trying several things and I got it close for issue two once and have not moved on to issue one. If anyone has any input for me, I would appreciate it. I'll be working on this until I get it figured out, so I will post any progress that I make.
Thanks!
Comment