I have a sharepoint 2010 farm with a few site collections set up on it. One of the sites has a list where and a custom NewForm.aspx is configured to populate the fields of the item.
Because I didn't want the user to be directed to source list when the form is submitted I coded the URL the users clicks (to get to the NewForm.aspx) with a ?source=httpp://sitename.com/siteWhereTheyClickedThelink.aspx redirect.
All this works just fine. The user clicks save and they go straight back to the page where they opened the form.
The problem now is that I cant figure out how to set the ?source= to a relative URL. For the part of the url prior to ?source I simply removed the "http://sitename.com/" and put a "./" in its place and that still works. I did this because I am going to use a copy of my current E3 for a newly stood up development environment and I don't want a hard coded URL in e1 to take me to a form, list or library in E3. Now I need to know how to format the redirect URL in the same way. I have tried the following:
?source=./siteWhereTheyClickedThelink.aspx ?source=http:./siteWhereTheyClickedThelink.aspx ?source=http://./siteWhereTheyClickedThelink.aspx ?source=http://../siteWhereTheyClickedThelink.aspx
Clearly I am new to all this and it is probably something quite simple but I haven't managed to figure it out. Any help would be appreciated.
?source=/siteWhereTheyClickedTheLink.aspx