I have a url which has two parameters and I have rewritten them in the htaccess file with this
RewriteRule ^subscriber/([^/.]+)/([^/.]+)/?$ subscriber/index.php?id=$1&name=$2 [NC,L]
The name in some cases contains a “/” which the browser is treating like another parameter and is giving me a 404 page. Is there a way to replace “/” to something else using the htaccess file?
Try putting this in the htaccess file in your document root:
This will make the first “folder” in the URI after subscriber/, the
idparam, and everything after that except for a trailing slash be thenameparam. The first set of rules then repeatedly clean out thenameparam, replacing/with-.