0
votes

I have a URL as follows: www.xyz.com/?_ARGS=/string/_includes/header/header.jsp_AF&_dynSessConf=1234567890&/atg/userprofiling/ProfileFormHandler.logout=true&_D%3A/atg/userprofiling/ProfileFormHandler.logout=+

I need to add /something after the root url to convert to the following form: www.xyz.com/something/?_ARGS=/string/_includes/header/header.jsp_AF&_dynSessConf=1234567890&/atg/userprofiling/ProfileFormHandler.logout=true&_D%3A/atg/userprofiling/ProfileFormHandler.logout=+

I have the rewrite condition figured out where logout=true is the main keyword. But I am not sure what the rewrite rule should be. RewriteEngine On RewriteCond %{QUERY_STRING} logout=true RewriteRule [QSA,NC,NE,R=301,L]

I need your suggestion guys. Thanks.

1

1 Answers

2
votes

If your first step in rewriting is to simply insert /something at the beginning of any URI that lacks it,

RewriteEngine On
RewriteCond  %{REQUEST_URI}  !^/something  [NC]
RewriteRule  ^(.*)$   /something/$1  [L]

could be enough. From there, you can do other rewrites as needed.